ApiKeyArgs

data class ApiKeyArgs(val applicationInsightsId: Output<String>? = null, val name: Output<String>? = null, val readPermissions: Output<List<String>>? = null, val writePermissions: Output<List<String>>? = null) : ConvertibleToJava<ApiKeyArgs>

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

Constructors

Link copied to clipboard
fun ApiKeyArgs(applicationInsightsId: Output<String>? = null, name: Output<String>? = null, readPermissions: Output<List<String>>? = null, writePermissions: Output<List<String>>? = null)

Functions

Link copied to clipboard
open override fun toJava(): ApiKeyArgs

Properties

Link copied to clipboard
val applicationInsightsId: Output<String>? = null

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 name: Output<String>? = null

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

Link copied to clipboard
val readPermissions: Output<List<String>>? = null

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 writePermissions: Output<List<String>>? = null

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.