az monitor app-insights api-key

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 -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 seperated list of names of read Roles for this API key to inherit.

--write-properties

A space seperated list of names of write Roles for this API key to inherit.

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
                                       --resource-group

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-keys 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.

--resource-group -g

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

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 --app
                                     --resource-group
                                     [--api-key]

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

Required 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.

--resource-group -g

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

Optional Parameters

--api-key

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