We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.appinsights.getInsights
Explore with Pulumi AI
Use this data source to access information about an existing Application Insights component.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.appinsights.getInsights({
    name: "production",
    resourceGroupName: "networking",
});
export const applicationInsightsInstrumentationKey = example.then(example => example.instrumentationKey);
import pulumi
import pulumi_azure as azure
example = azure.appinsights.get_insights(name="production",
    resource_group_name="networking")
pulumi.export("applicationInsightsInstrumentationKey", example.instrumentation_key)
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/appinsights"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := appinsights.LookupInsights(ctx, &appinsights.LookupInsightsArgs{
			Name:              "production",
			ResourceGroupName: "networking",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("applicationInsightsInstrumentationKey", example.InstrumentationKey)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = Azure.AppInsights.GetInsights.Invoke(new()
    {
        Name = "production",
        ResourceGroupName = "networking",
    });
    return new Dictionary<string, object?>
    {
        ["applicationInsightsInstrumentationKey"] = example.Apply(getInsightsResult => getInsightsResult.InstrumentationKey),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.appinsights.AppinsightsFunctions;
import com.pulumi.azure.appinsights.inputs.GetInsightsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var example = AppinsightsFunctions.getInsights(GetInsightsArgs.builder()
            .name("production")
            .resourceGroupName("networking")
            .build());
        ctx.export("applicationInsightsInstrumentationKey", example.applyValue(getInsightsResult -> getInsightsResult.instrumentationKey()));
    }
}
variables:
  example:
    fn::invoke:
      function: azure:appinsights:getInsights
      arguments:
        name: production
        resourceGroupName: networking
outputs:
  applicationInsightsInstrumentationKey: ${example.instrumentationKey}
Using getInsights
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getInsights(args: GetInsightsArgs, opts?: InvokeOptions): Promise<GetInsightsResult>
function getInsightsOutput(args: GetInsightsOutputArgs, opts?: InvokeOptions): Output<GetInsightsResult>def get_insights(name: Optional[str] = None,
                 resource_group_name: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetInsightsResult
def get_insights_output(name: Optional[pulumi.Input[str]] = None,
                 resource_group_name: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetInsightsResult]func LookupInsights(ctx *Context, args *LookupInsightsArgs, opts ...InvokeOption) (*LookupInsightsResult, error)
func LookupInsightsOutput(ctx *Context, args *LookupInsightsOutputArgs, opts ...InvokeOption) LookupInsightsResultOutput> Note: This function is named LookupInsights in the Go SDK.
public static class GetInsights 
{
    public static Task<GetInsightsResult> InvokeAsync(GetInsightsArgs args, InvokeOptions? opts = null)
    public static Output<GetInsightsResult> Invoke(GetInsightsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetInsightsResult> getInsights(GetInsightsArgs args, InvokeOptions options)
public static Output<GetInsightsResult> getInsights(GetInsightsArgs args, InvokeOptions options)
fn::invoke:
  function: azure:appinsights/getInsights:getInsights
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
- Specifies the name of the Application Insights component.
- ResourceGroup stringName 
- Specifies the name of the resource group the Application Insights component is located in.
- Name string
- Specifies the name of the Application Insights component.
- ResourceGroup stringName 
- Specifies the name of the resource group the Application Insights component is located in.
- name String
- Specifies the name of the Application Insights component.
- resourceGroup StringName 
- Specifies the name of the resource group the Application Insights component is located in.
- name string
- Specifies the name of the Application Insights component.
- resourceGroup stringName 
- Specifies the name of the resource group the Application Insights component is located in.
- name str
- Specifies the name of the Application Insights component.
- resource_group_ strname 
- Specifies the name of the resource group the Application Insights component is located in.
- name String
- Specifies the name of the Application Insights component.
- resourceGroup StringName 
- Specifies the name of the resource group the Application Insights component is located in.
getInsights Result
The following output properties are available:
- AppId string
- The App ID associated with this Application Insights component.
- ApplicationType string
- The type of the component.
- ConnectionString string
- The connection string of the Application Insights component. (Sensitive)
- Id string
- The provider-assigned unique ID for this managed resource.
- InstrumentationKey string
- The instrumentation key of the Application Insights component.
- Location string
- The Azure location where the component exists.
- Name string
- ResourceGroup stringName 
- RetentionIn intDays 
- The retention period in days.
- Dictionary<string, string>
- Tags applied to the component.
- WorkspaceId string
- The id of the associated Log Analytics workspace
- AppId string
- The App ID associated with this Application Insights component.
- ApplicationType string
- The type of the component.
- ConnectionString string
- The connection string of the Application Insights component. (Sensitive)
- Id string
- The provider-assigned unique ID for this managed resource.
- InstrumentationKey string
- The instrumentation key of the Application Insights component.
- Location string
- The Azure location where the component exists.
- Name string
- ResourceGroup stringName 
- RetentionIn intDays 
- The retention period in days.
- map[string]string
- Tags applied to the component.
- WorkspaceId string
- The id of the associated Log Analytics workspace
- appId String
- The App ID associated with this Application Insights component.
- applicationType String
- The type of the component.
- connectionString String
- The connection string of the Application Insights component. (Sensitive)
- id String
- The provider-assigned unique ID for this managed resource.
- instrumentationKey String
- The instrumentation key of the Application Insights component.
- location String
- The Azure location where the component exists.
- name String
- resourceGroup StringName 
- retentionIn IntegerDays 
- The retention period in days.
- Map<String,String>
- Tags applied to the component.
- workspaceId String
- The id of the associated Log Analytics workspace
- appId string
- The App ID associated with this Application Insights component.
- applicationType string
- The type of the component.
- connectionString string
- The connection string of the Application Insights component. (Sensitive)
- id string
- The provider-assigned unique ID for this managed resource.
- instrumentationKey string
- The instrumentation key of the Application Insights component.
- location string
- The Azure location where the component exists.
- name string
- resourceGroup stringName 
- retentionIn numberDays 
- The retention period in days.
- {[key: string]: string}
- Tags applied to the component.
- workspaceId string
- The id of the associated Log Analytics workspace
- app_id str
- The App ID associated with this Application Insights component.
- application_type str
- The type of the component.
- connection_string str
- The connection string of the Application Insights component. (Sensitive)
- id str
- The provider-assigned unique ID for this managed resource.
- instrumentation_key str
- The instrumentation key of the Application Insights component.
- location str
- The Azure location where the component exists.
- name str
- resource_group_ strname 
- retention_in_ intdays 
- The retention period in days.
- Mapping[str, str]
- Tags applied to the component.
- workspace_id str
- The id of the associated Log Analytics workspace
- appId String
- The App ID associated with this Application Insights component.
- applicationType String
- The type of the component.
- connectionString String
- The connection string of the Application Insights component. (Sensitive)
- id String
- The provider-assigned unique ID for this managed resource.
- instrumentationKey String
- The instrumentation key of the Application Insights component.
- location String
- The Azure location where the component exists.
- name String
- resourceGroup StringName 
- retentionIn NumberDays 
- The retention period in days.
- Map<String>
- Tags applied to the component.
- workspaceId String
- The id of the associated Log Analytics workspace
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.