Module appinsights

@pulumi/azure > appinsights

class ApiKey

extends CustomResource

Manages an Application Insights API key.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West Europe",
    name: "tf-test",
});
const testInsights = new azure.appinsights.Insights("test", {
    applicationType: "web",
    location: "West Europe",
    name: "tf-test-appinsights",
    resourceGroupName: testResourceGroup.name,
});
const authenticateSdkControlChannelApiKey = new azure.appinsights.ApiKey("authenticate_sdk_control_channel", {
    applicationInsightsId: testInsights.id,
    name: "tf-test-appinsights-authenticate-sdk-control-channel-api-key",
    readPermissions: ["agentconfig"],
});
const fullPermissions = new azure.appinsights.ApiKey("full_permissions", {
    applicationInsightsId: testInsights.id,
    name: "tf-test-appinsights-full-permissions-api-key",
    readPermissions: [
        "agentconfig",
        "aggregate",
        "api",
        "draft",
        "extendqueries",
        "search",
    ],
    writePermissions: ["annotations"],
});
const readTelemetry = new azure.appinsights.ApiKey("read_telemetry", {
    applicationInsightsId: testInsights.id,
    name: "tf-test-appinsights-read-telemetry-api-key",
    readPermissions: [
        "aggregate",
        "api",
        "draft",
        "extendqueries",
        "search",
    ],
});
const writeAnnotations = new azure.appinsights.ApiKey("write_annotations", {
    applicationInsightsId: testInsights.id,
    name: "tf-test-appinsights-write-annotations-api-key",
    writePermissions: ["annotations"],
});

export const authenticateSdkControlChannel = authenticateSdkControlChannelApiKey.apiKey;
export const fullPermissionsApiKey = fullPermissions.apiKey;
export const readTelemetryApiKey = readTelemetry.apiKey;
export const writeAnnotationsApiKey = writeAnnotations.apiKey;

constructor

new ApiKey(name: string, args: ApiKeyArgs, opts?: pulumi.CustomResourceOptions)

Create a ApiKey resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ApiKeyState, opts?: pulumi.CustomResourceOptions): ApiKey

Get an existing ApiKey resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property apiKey

public apiKey: pulumi.Output<string>;

The API Key secret (Sensitive).

property applicationInsightsId

public applicationInsightsId: pulumi.Output<string>;

The ID of the Application Insights component on which the API key operates. Changing this forces a new resource to be created.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

Specifies the name of the Application Insights API key. Changing this forces a new resource to be created.

property readPermissions

public readPermissions: pulumi.Output<string[] | undefined>;

Specifies the list of read permissions granted to the API key. Valid values are agentconfig, aggregate, api, draft, extendqueries, search. Please note these values are case sensitive. Changing this forces a new resource to be created.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property writePermissions

public writePermissions: pulumi.Output<string[] | undefined>;

Specifies the list of write permissions granted to the API key. Valid values are annotations. Please note these values are case sensitive. Changing this forces a new resource to be created.

class Insights

extends CustomResource

Manage an Application Insights component.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West Europe",
    name: "tf-test",
});
const testInsights = new azure.appinsights.Insights("test", {
    applicationType: "Web",
    location: "West Europe",
    name: "tf-test-appinsights",
    resourceGroupName: testResourceGroup.name,
});

export const appId = testInsights.appId;
export const instrumentationKey = testInsights.instrumentationKey;

constructor

new Insights(name: string, args: InsightsArgs, opts?: pulumi.CustomResourceOptions)

Create a Insights resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: InsightsState, opts?: pulumi.CustomResourceOptions): Insights

Get an existing Insights resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property appId

public appId: pulumi.Output<string>;

The App ID associated with this Application Insights component.

property applicationType

public applicationType: pulumi.Output<string>;

Specifies the type of Application Insights to create. Valid values are ios for iOS, java for Java web, MobileCenter for App Center, Node.JS for Node.js, other for General, phone for Windows Phone, store for Windows Store and web for ASP.NET. Please note these values are case sensitive; unmatched values are treated as ASP.NET by Azure. Changing this forces a new resource to be created.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property instrumentationKey

public instrumentationKey: pulumi.Output<string>;

The Instrumentation Key for this Application Insights component.

property location

public location: pulumi.Output<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

public name: pulumi.Output<string>;

Specifies the name of the Application Insights component. Changing this forces a new resource to be created.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which to create the Application Insights component.

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

function getInsights

getInsights(args: GetInsightsArgs, opts?: pulumi.InvokeOptions): Promise<GetInsightsResult>

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 test = pulumi.output(azure.appinsights.getInsights({
    name: "production",
    resourceGroupName: "networking",
}));

export const applicationInsightsInstrumentationKey = test.apply(test => test.instrumentationKey);

interface ApiKeyArgs

The set of arguments for constructing a ApiKey resource.

property applicationInsightsId

applicationInsightsId: pulumi.Input<string>;

The ID of the Application Insights component on which the API key operates. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

Specifies the name of the Application Insights API key. Changing this forces a new resource to be created.

property readPermissions

readPermissions?: pulumi.Input<pulumi.Input<string>[]>;

Specifies the list of read permissions granted to the API key. Valid values are agentconfig, aggregate, api, draft, extendqueries, search. Please note these values are case sensitive. Changing this forces a new resource to be created.

property writePermissions

writePermissions?: pulumi.Input<pulumi.Input<string>[]>;

Specifies the list of write permissions granted to the API key. Valid values are annotations. Please note these values are case sensitive. Changing this forces a new resource to be created.

interface ApiKeyState

Input properties used for looking up and filtering ApiKey resources.

property apiKey

apiKey?: pulumi.Input<string>;

The API Key secret (Sensitive).

property applicationInsightsId

applicationInsightsId?: pulumi.Input<string>;

The ID of the Application Insights component on which the API key operates. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

Specifies the name of the Application Insights API key. Changing this forces a new resource to be created.

property readPermissions

readPermissions?: pulumi.Input<pulumi.Input<string>[]>;

Specifies the list of read permissions granted to the API key. Valid values are agentconfig, aggregate, api, draft, extendqueries, search. Please note these values are case sensitive. Changing this forces a new resource to be created.

property writePermissions

writePermissions?: pulumi.Input<pulumi.Input<string>[]>;

Specifies the list of write permissions granted to the API key. Valid values are annotations. Please note these values are case sensitive. Changing this forces a new resource to be created.

interface GetInsightsArgs

A collection of arguments for invoking getInsights.

property name

name: string;

Specifies the name of the Application Insights component.

property resourceGroupName

resourceGroupName: string;

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

interface GetInsightsResult

A collection of values returned by getInsights.

property appId

appId: string;

The App ID associated with this Application Insights component.

property applicationType

applicationType: string;

The type of the component.

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property instrumentationKey

instrumentationKey: string;

The instrumentation key of the Application Insights component.

property location

location: string;

The Azure location where the component exists.

property name

name: string;

property resourceGroupName

resourceGroupName: string;

property tags

tags: {[key: string]: any};

Tags applied to the component.

interface InsightsArgs

The set of arguments for constructing a Insights resource.

property applicationType

applicationType: pulumi.Input<string>;

Specifies the type of Application Insights to create. Valid values are ios for iOS, java for Java web, MobileCenter for App Center, Node.JS for Node.js, other for General, phone for Windows Phone, store for Windows Store and web for ASP.NET. Please note these values are case sensitive; unmatched values are treated as ASP.NET by Azure. Changing this forces a new resource to be created.

property location

location: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

Specifies the name of the Application Insights component. Changing this forces a new resource to be created.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which to create the Application Insights component.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

interface InsightsState

Input properties used for looking up and filtering Insights resources.

property appId

appId?: pulumi.Input<string>;

The App ID associated with this Application Insights component.

property applicationType

applicationType?: pulumi.Input<string>;

Specifies the type of Application Insights to create. Valid values are ios for iOS, java for Java web, MobileCenter for App Center, Node.JS for Node.js, other for General, phone for Windows Phone, store for Windows Store and web for ASP.NET. Please note these values are case sensitive; unmatched values are treated as ASP.NET by Azure. Changing this forces a new resource to be created.

property instrumentationKey

instrumentationKey?: pulumi.Input<string>;

The Instrumentation Key for this Application Insights component.

property location

location?: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

Specifies the name of the Application Insights component. Changing this forces a new resource to be created.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the Application Insights component.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.