Azure Classic

Pulumi Official
Package maintained by Pulumi
v5.10.0 published on Friday, Jun 10, 2022 by Pulumi

getInsights

Use this data source to access information about an existing Application Insights component.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Azure.AppInsights.GetInsights.InvokeAsync(new Azure.AppInsights.GetInsightsArgs
        {
            Name = "production",
            ResourceGroupName = "networking",
        }));
        this.ApplicationInsightsInstrumentationKey = example.Apply(example => example.InstrumentationKey);
    }

    [Output("applicationInsightsInstrumentationKey")]
    public Output<string> ApplicationInsightsInstrumentationKey { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/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
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = Output.of(AppinsightsFunctions.getInsights(GetInsightsArgs.builder()
            .name("production")
            .resourceGroupName("networking")
            .build()));

        ctx.export("applicationInsightsInstrumentationKey", example.apply(getInsightsResult -> getInsightsResult.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)
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);
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)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: azure:appinsights/getInsights:getInsights
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Name string

Specifies the name of the Application Insights component.

ResourceGroupName string

Specifies the name of the resource group the Application Insights component is located in.

Name string

Specifies the name of the Application Insights component.

ResourceGroupName string

Specifies the name of the resource group the Application Insights component is located in.

name String

Specifies the name of the Application Insights component.

resourceGroupName String

Specifies the name of the resource group the Application Insights component is located in.

name string

Specifies the name of the Application Insights component.

resourceGroupName string

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_name str

Specifies the name of the resource group the Application Insights component is located in.

name String

Specifies the name of the Application Insights component.

resourceGroupName String

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
ResourceGroupName string
RetentionInDays int

The retention period in days.

Tags 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
ResourceGroupName string
RetentionInDays int

The retention period in days.

Tags 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
resourceGroupName String
retentionInDays Integer

The retention period in days.

tags 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
resourceGroupName string
retentionInDays number

The retention period in days.

tags {[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_name str
retention_in_days int

The retention period in days.

tags 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
resourceGroupName String
retentionInDays Number

The retention period in days.

tags Map<String>

Tags applied to the component.

workspaceId String

The id of the associated Log Analytics workspace

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.