az monitor app-insights api-key
Note
This reference is part of the application-insights extension for the Azure CLI (version 2.55.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
Name | Description | Type | Status |
---|---|---|---|
az monitor app-insights api-key create |
Create an API Key of an Application Insights component. |
Extension | GA |
az monitor app-insights api-key delete |
Delete an API key from an Application Insights resource. |
Extension | GA |
az monitor app-insights api-key show |
Get all keys or a specific API key associated with an Application Insights resource. |
Extension | GA |
az monitor app-insights api-key create
Create an API Key of an Application Insights component.
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
Name of the API key to create.
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.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
A space-separated list of names of read Roles for this API key to inherit. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
A space-separated list of names of write Roles for this API key to inherit. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
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]
[--yes]
Examples
Delete API Key.
az monitor app-insights api-key delete --app demoApp -g demoRg --api-key demo-key
Optional Parameters
Name of the API key to delete. Can be found using api-key show
.
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.
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.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Do not prompt for confirmation.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
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
The name of the Application Insights component resource.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Name of the API key to fetch. Can be found using api-key show
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.