We recommend using Azure Native.
Azure Classic v6.3.1 published on Tuesday, Oct 1, 2024 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)
// 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.
- Resource
Group 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.
- Resource
Group 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.
- resource
Group 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.
- resource
Group 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.
- resource
Group StringName - Specifies the name of the resource group the Application Insights component is located in.
getInsights Result
The following output properties are available:
- App
Id string - The App ID associated with this Application Insights component.
- Application
Type string - The type of the component.
- Connection
String string - The connection string of the Application Insights component. (Sensitive)
- Id string
- The provider-assigned unique ID for this managed resource.
- Instrumentation
Key string - The instrumentation key of the Application Insights component.
- Location string
- The Azure location where the component exists.
- Name string
- Resource
Group stringName - Retention
In intDays - The retention period in days.
- Dictionary<string, string>
- Tags applied to the component.
- Workspace
Id string - The id of the associated Log Analytics workspace
- App
Id string - The App ID associated with this Application Insights component.
- Application
Type string - The type of the component.
- Connection
String string - The connection string of the Application Insights component. (Sensitive)
- Id string
- The provider-assigned unique ID for this managed resource.
- Instrumentation
Key string - The instrumentation key of the Application Insights component.
- Location string
- The Azure location where the component exists.
- Name string
- Resource
Group stringName - Retention
In intDays - The retention period in days.
- map[string]string
- Tags applied to the component.
- Workspace
Id string - The id of the associated Log Analytics workspace
- app
Id String - The App ID associated with this Application Insights component.
- application
Type String - The type of the component.
- connection
String String - The connection string of the Application Insights component. (Sensitive)
- id String
- The provider-assigned unique ID for this managed resource.
- instrumentation
Key String - The instrumentation key of the Application Insights component.
- location String
- The Azure location where the component exists.
- name String
- resource
Group StringName - retention
In IntegerDays - The retention period in days.
- Map<String,String>
- Tags applied to the component.
- workspace
Id String - The id of the associated Log Analytics workspace
- app
Id string - The App ID associated with this Application Insights component.
- application
Type string - The type of the component.
- connection
String string - The connection string of the Application Insights component. (Sensitive)
- id string
- The provider-assigned unique ID for this managed resource.
- instrumentation
Key string - The instrumentation key of the Application Insights component.
- location string
- The Azure location where the component exists.
- name string
- resource
Group stringName - retention
In numberDays - The retention period in days.
- {[key: string]: string}
- Tags applied to the component.
- workspace
Id 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
- app
Id String - The App ID associated with this Application Insights component.
- application
Type String - The type of the component.
- connection
String String - The connection string of the Application Insights component. (Sensitive)
- id String
- The provider-assigned unique ID for this managed resource.
- instrumentation
Key String - The instrumentation key of the Application Insights component.
- location String
- The Azure location where the component exists.
- name String
- resource
Group StringName - retention
In NumberDays - The retention period in days.
- Map<String>
- Tags applied to the component.
- workspace
Id 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
azurerm
Terraform Provider.