Class ApiKey
Manages an Application Insights API key.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
{
Location = "West Europe",
});
var exampleInsights = new Azure.AppInsights.Insights("exampleInsights", new Azure.AppInsights.InsightsArgs
{
Location = "West Europe",
ResourceGroupName = exampleResourceGroup.Name,
ApplicationType = "web",
});
var readTelemetry = new Azure.AppInsights.ApiKey("readTelemetry", new Azure.AppInsights.ApiKeyArgs
{
ApplicationInsightsId = exampleInsights.Id,
ReadPermissions =
{
"aggregate",
"api",
"draft",
"extendqueries",
"search",
},
});
var writeAnnotations = new Azure.AppInsights.ApiKey("writeAnnotations", new Azure.AppInsights.ApiKeyArgs
{
ApplicationInsightsId = exampleInsights.Id,
WritePermissions =
{
"annotations",
},
});
var authenticateSdkControlChannelApiKey = new Azure.AppInsights.ApiKey("authenticateSdkControlChannelApiKey", new Azure.AppInsights.ApiKeyArgs
{
ApplicationInsightsId = exampleInsights.Id,
ReadPermissions =
{
"agentconfig",
},
});
var fullPermissions = new Azure.AppInsights.ApiKey("fullPermissions", new Azure.AppInsights.ApiKeyArgs
{
ApplicationInsightsId = exampleInsights.Id,
ReadPermissions =
{
"agentconfig",
"aggregate",
"api",
"draft",
"extendqueries",
"search",
},
WritePermissions =
{
"annotations",
},
});
this.ReadTelemetryApiKey = readTelemetry.ApiKey;
this.WriteAnnotationsApiKey = writeAnnotations.ApiKey;
this.AuthenticateSdkControlChannel = authenticateSdkControlChannelApiKey.ApiKey;
this.FullPermissionsApiKey = fullPermissions.ApiKey;
}
[Output("readTelemetryApiKey")]
public Output<string> ReadTelemetryApiKey { get; set; }
[Output("writeAnnotationsApiKey")]
public Output<string> WriteAnnotationsApiKey { get; set; }
[Output("authenticateSdkControlChannel")]
public Output<string> AuthenticateSdkControlChannel { get; set; }
[Output("fullPermissionsApiKey")]
public Output<string> FullPermissionsApiKey { get; set; }
}
Inherited Members
Namespace: Pulumi.Azure.AppInsights
Assembly: Pulumi.Azure.dll
Syntax
public class ApiKey : CustomResource
Constructors
View SourceApiKey(String, ApiKeyArgs, CustomResourceOptions)
Create a ApiKey resource with the given unique name, arguments, and options.
Declaration
public ApiKey(string name, ApiKeyArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| ApiKeyArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceApplicationInsightsId
The ID of the Application Insights component on which the API key operates. Changing this forces a new resource to be created.
Declaration
public Output<string> ApplicationInsightsId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Key
The API Key secret (Sensitive).
Declaration
public Output<string> Key { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
Specifies the name of the Application Insights API key. Changing this forces a new resource to be created.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ReadPermissions
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.
Declaration
public Output<ImmutableArray<string>> ReadPermissions { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
WritePermissions
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.
Declaration
public Output<ImmutableArray<string>> WritePermissions { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Methods
View SourceGet(String, Input<String>, ApiKeyState, CustomResourceOptions)
Get an existing ApiKey resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static ApiKey Get(string name, Input<string> id, ApiKeyState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| ApiKeyState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| ApiKey |