แชร์ผ่าน


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

--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. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--write-properties

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
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

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

--api-key

Name of the API key to delete. 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.

--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

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

--app -a

The name of the Application Insights component resource.

--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-key show.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.