ApiKey

class ApiKey : KotlinCustomResource

Manages an Application Insights API key.

Example Usage

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.ApiKey;
import com.pulumi.azure.appinsights.ApiKeyArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.applicationType("web")
.build());
var readTelemetry = new ApiKey("readTelemetry", ApiKeyArgs.builder()
.applicationInsightsId(exampleInsights.id())
.readPermissions(
"aggregate",
"api",
"draft",
"extendqueries",
"search")
.build());
var writeAnnotations = new ApiKey("writeAnnotations", ApiKeyArgs.builder()
.applicationInsightsId(exampleInsights.id())
.writePermissions("annotations")
.build());
var authenticateSdkControlChannelApiKey = new ApiKey("authenticateSdkControlChannelApiKey", ApiKeyArgs.builder()
.applicationInsightsId(exampleInsights.id())
.readPermissions("agentconfig")
.build());
var fullPermissions = new ApiKey("fullPermissions", ApiKeyArgs.builder()
.applicationInsightsId(exampleInsights.id())
.readPermissions(
"agentconfig",
"aggregate",
"api",
"draft",
"extendqueries",
"search")
.writePermissions("annotations")
.build());
ctx.export("readTelemetryApiKey", readTelemetry.apiKey());
ctx.export("writeAnnotationsApiKey", writeAnnotations.apiKey());
ctx.export("authenticateSdkControlChannel", authenticateSdkControlChannelApiKey.apiKey());
ctx.export("fullPermissionsApiKey", fullPermissions.apiKey());
}
}

Import

Application Insights API keys can be imported using the resource id, e.g.

$ pulumi import azure:appinsights/apiKey:ApiKey my_key /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Insights/components/instance1/apiKeys/00000000-0000-0000-0000-000000000000

Properties

Link copied to clipboard
val apiKey: Output<String>

The API Key secret (Sensitive).

Link copied to clipboard

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

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

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

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val readPermissions: Output<List<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.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

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.