az monitor app-insights api-key

Note

This reference is part of the application-insights extension for the Azure CLI (version 2.38.0 or higher). The extension will automatically install the first time you run an az monitor app-insights api-key command. Learn more about extensions.

Operations on API keys associated with an Application Insights component.

Commands

az monitor app-insights api-key create

Create a new API key for use with an Application Insights resource.

az monitor app-insights api-key delete

Delete an API key from an Application Insights resource.

az monitor app-insights api-key show

Get all keys or a specific API key associated with an Application Insights resource.

az monitor app-insights api-key create

Create a new API key for use with an Application Insights resource.

az monitor app-insights api-key create --api-key
                                       --app
                                       --resource-group
                                       [--read-properties]
                                       [--write-properties]

Examples

Create a component with kind web and location.

az monitor app-insights api-key create --api-key cli-demo --read-properties ReadTelemetry --write-properties WriteAnnotations -g demoRg --app testApp

Create a component with kind web and location without any permission

az monitor app-insights api-key create --api-key cli-demo --read-properties '""' --write-properties '""' -g demoRg --app testApp

Required Parameters

--api-key

Name of the API key to create.

--app -a

GUID, app name, or fully-qualified Azure resource name of Application Insights component. The application GUID may be acquired from the API Access menu item on any Application Insights resource in the Azure portal. If using an application name, please specify resource group.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--read-properties

A space-separated list of names of read Roles for this API key to inherit. Possible values include ReadTelemetry, AuthenticateSDKControlChannel and "".

--write-properties

A space-separated list of names of write Roles for this API key to inherit. Possible values include WriteAnnotations and "".

az monitor app-insights api-key delete

Delete an API key from an Application Insights resource.

az monitor app-insights api-key delete --api-key
                                       [--app]
                                       [--ids]
                                       [--resource-group]
                                       [--subscription]

Examples

Delete API Key.

az monitor app-insights api-key delete --app demoApp -g demoRg --api-key demo-key

Required Parameters

--api-key

Name of the API key to delete. Can be found using api-key show.

Optional Parameters

--app -a

GUID, app name, or fully-qualified Azure resource name of Application Insights component. The application GUID may be acquired from the API Access menu item on any Application Insights resource in the Azure portal. If using an application name, please specify resource group.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az monitor app-insights api-key show

Get all keys or a specific API key associated with an Application Insights resource.

az monitor app-insights api-key show [--api-key]
                                     [--app]
                                     [--ids]
                                     [--resource-group]
                                     [--subscription]

Examples

Fetch API Key.

az monitor app-insights api-key show --app demoApp -g demoRg --api-key demo-key

Fetch API Keys.

az monitor app-insights api-key show --app demoApp -g demoRg

Optional Parameters

--api-key

Name of the API key to fetch. Can be found using api-key show.

--app -a

GUID, app name, or fully-qualified Azure resource name of Application Insights component. The application GUID may be acquired from the API Access menu item on any Application Insights resource in the Azure portal. If using an application name, please specify resource group.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.