Analytics Item Args
data class AnalyticsItemArgs(val applicationInsightsId: Output<String>? = null, val content: Output<String>? = null, val functionAlias: Output<String>? = null, val name: Output<String>? = null, val scope: Output<String>? = null, val type: Output<String>? = null) : ConvertibleToJava<AnalyticsItemArgs>
Manages an Application Insights Analytics Item component.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "tf-test",
location: "West Europe",
});
const exampleInsights = new azure.appinsights.Insights("example", {
name: "tf-test-appinsights",
location: example.location,
resourceGroupName: example.name,
applicationType: "web",
});
const exampleAnalyticsItem = new azure.appinsights.AnalyticsItem("example", {
name: "testquery",
applicationInsightsId: exampleInsights.id,
content: "requests //simple example query",
scope: "shared",
type: "query",
});
Content copied to clipboard
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="tf-test",
location="West Europe")
example_insights = azure.appinsights.Insights("example",
name="tf-test-appinsights",
location=example.location,
resource_group_name=example.name,
application_type="web")
example_analytics_item = azure.appinsights.AnalyticsItem("example",
name="testquery",
application_insights_id=example_insights.id,
content="requests //simple example query",
scope="shared",
type="query")
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "tf-test",
Location = "West Europe",
});
var exampleInsights = new Azure.AppInsights.Insights("example", new()
{
Name = "tf-test-appinsights",
Location = example.Location,
ResourceGroupName = example.Name,
ApplicationType = "web",
});
var exampleAnalyticsItem = new Azure.AppInsights.AnalyticsItem("example", new()
{
Name = "testquery",
ApplicationInsightsId = exampleInsights.Id,
Content = "requests //simple example query",
Scope = "shared",
Type = "query",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/appinsights"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("tf-test"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleInsights, err := appinsights.NewInsights(ctx, "example", &appinsights.InsightsArgs{
Name: pulumi.String("tf-test-appinsights"),
Location: example.Location,
ResourceGroupName: example.Name,
ApplicationType: pulumi.String("web"),
})
if err != nil {
return err
}
_, err = appinsights.NewAnalyticsItem(ctx, "example", &appinsights.AnalyticsItemArgs{
Name: pulumi.String("testquery"),
ApplicationInsightsId: exampleInsights.ID(),
Content: pulumi.String("requests //simple example query"),
Scope: pulumi.String("shared"),
Type: pulumi.String("query"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.appinsights.Insights;
import com.pulumi.azure.appinsights.InsightsArgs;
import com.pulumi.azure.appinsights.AnalyticsItem;
import com.pulumi.azure.appinsights.AnalyticsItemArgs;
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) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("tf-test")
.location("West Europe")
.build());
var exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
.name("tf-test-appinsights")
.location(example.location())
.resourceGroupName(example.name())
.applicationType("web")
.build());
var exampleAnalyticsItem = new AnalyticsItem("exampleAnalyticsItem", AnalyticsItemArgs.builder()
.name("testquery")
.applicationInsightsId(exampleInsights.id())
.content("requests //simple example query")
.scope("shared")
.type("query")
.build());
}
}
Content copied to clipboard
resources:
example:
type: azure:core:ResourceGroup
properties:
name: tf-test
location: West Europe
exampleInsights:
type: azure:appinsights:Insights
name: example
properties:
name: tf-test-appinsights
location: ${example.location}
resourceGroupName: ${example.name}
applicationType: web
exampleAnalyticsItem:
type: azure:appinsights:AnalyticsItem
name: example
properties:
name: testquery
applicationInsightsId: ${exampleInsights.id}
content: requests //simple example query
scope: shared
type: query
Content copied to clipboard
Import
Application Insights Analytics Items can be imported using the resource id
, e.g.
$ pulumi import azure:appinsights/analyticsItem:AnalyticsItem example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Insights/components/mycomponent1/analyticsItems/11111111-1111-1111-1111-111111111111
Content copied to clipboard
To find the Analytics Item ID you can query the REST API using the az rest
CLI command, e.g. az rest --method GET --uri "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/microsoft.insights/components/appinsightstest/analyticsItems?api-version=2015-05-01"