az monitor app-insights component

Note

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

Manage an Application Insights component or its subcomponents.

Commands

az monitor app-insights component billing

Manage an Application Insights component billing features.

az monitor app-insights component billing show

Show the billing features of an Application Insights resource.

az monitor app-insights component billing update

Update the billing features of an Application Insights resource.

az monitor app-insights component connect-function

Connect AI to an Azure function.

az monitor app-insights component connect-webapp

Connect AI to a web app.

az monitor app-insights component continues-export

Manage Continuous Export configurations for an Application Insights component.

az monitor app-insights component continues-export create

Create a Continuous Export configuration for an Application Insights component.

az monitor app-insights component continues-export delete

Delete a specific Continuous Export configuration of an Application Insights component.

az monitor app-insights component continues-export list

List Continuous Export configurations for an Application Insights component.

az monitor app-insights component continues-export show

Get a specific Continuous Export configuration of an Application Insights component.

az monitor app-insights component continues-export update

Update a Continuous Export configuration for an Application Insights component.

az monitor app-insights component create

Create a new Application Insights resource.

az monitor app-insights component delete

Delete a new Application Insights resource.

az monitor app-insights component linked-storage

Manage linked storage account for an Application Insights component.

az monitor app-insights component linked-storage link

Link a storage account with an Application Insights component.

az monitor app-insights component linked-storage show

Show the details of linked storage account for an Application Insights component.

az monitor app-insights component linked-storage unlink

Unlink a storage account with an Application Insights component.

az monitor app-insights component linked-storage update

Update the linked storage account for an Application Insights component.

az monitor app-insights component show

Get an Application Insights resource.

az monitor app-insights component update

Update properties on an existing Application Insights resource. The primary value which can be updated is kind, which customizes the UI experience.

az monitor app-insights component update-tags

Update tags on an existing Application Insights resource.

az monitor app-insights component connect-function

Connect AI to an Azure function.

az monitor app-insights component connect-function --app
                                                   --function
                                                   --resource-group

Examples

Connect AI to an Azure function.

az monitor app-insights component connect-function -g myRG -a myAI --function myFunction

Connect AI to an Azure function using resource id.

az monitor app-insights component connect-function -g myRG -a myAI --function /subscriptions/mySub/resourceGroups/myRG/providers/Microsoft.Web/sites/myFunction

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.

--function

Name or resource id of the Azure function.

--resource-group -g

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

az monitor app-insights component connect-webapp

Connect AI to a web app.

az monitor app-insights component connect-webapp --app
                                                 --resource-group
                                                 --web-app
                                                 [--enable-debugger {false, true}]
                                                 [--enable-profiler {false, true}]

Examples

Connect AI to a web app and enable both profiler and snapshot debugger for the web app.

az monitor app-insights component connect-webapp -g myRG -a myAI --web-app myApp --enable-profiler --enable-snapshot-debugger

Connect AI to a web app using resource id and enable profiler and disable snapshot debugger for the web app.

az monitor app-insights component connect-webapp -g myRG -a myAI --web-app /subscriptions/mySub/resourceGroups/myRG/providers/Microsoft.Web/sites/myApp --enable-profiler --enable-snapshot-debugger false

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

--web-app

Name or resource id of the web app.

Optional Parameters

--enable-debugger --enable-snapshot-debugger

Enable snapshot debugger when an exception is thrown. Currently it is only supported for .NET/.NET Core Web Apps.

accepted values: false, true
--enable-profiler

Enable collecting profiling traces that help you see where time is spent in code. Currently it is only supported for .NET/.NET Core Web Apps.

accepted values: false, true

az monitor app-insights component create

Create a new Application Insights resource.

az monitor app-insights component create --app
                                         --location
                                         --resource-group
                                         [--application-type]
                                         [--ingestion-access {Disabled, Enabled}]
                                         [--kind]
                                         [--query-access {Disabled, Enabled}]
                                         [--retention-time]
                                         [--tags]
                                         [--workspace]

Examples

Create a component with kind web and location.

az monitor app-insights component create --app demoApp --location westus2 --kind web -g demoRg --application-type web --retention-time 120

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.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--resource-group -g

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

Optional Parameters

--application-type

Type of application being monitored.

default value: web
--ingestion-access

The public network access type for accessing Application Insights ingestion.

accepted values: Disabled, Enabled
--kind -k

The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of web, ios, other, store, java, phone.

default value: web
--query-access

The public network access type for accessing Application Insights query.

accepted values: Disabled, Enabled
--retention-time

Retention in days for Application Insights. The value can be one of the following values: 30,60,90,120,180,270,365,550,730. It can be set only when Application Insights is not connected to a Log Analytics workspace.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--workspace

Name or resource ID of a log analytics workspace.

az monitor app-insights component delete

Delete a new Application Insights resource.

az monitor app-insights component delete --app
                                         --resource-group

Examples

Delete a component with kind web and location.

az monitor app-insights component delete --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>.

az monitor app-insights component show

Get an Application Insights resource.

az monitor app-insights component show [--app]
                                       [--resource-group]

Examples

Get a component by name.

az monitor app-insights component show --app demoApp -g demoRg

List components in a resource group.

az monitor app-insights component show -g demoRg

List components in the currently selected subscription.

az monitor app-insights component 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.

--resource-group -g

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

az monitor app-insights component update

Update properties on an existing Application Insights resource. The primary value which can be updated is kind, which customizes the UI experience.

az monitor app-insights component update --app
                                         --resource-group
                                         [--ingestion-access {Disabled, Enabled}]
                                         [--kind]
                                         [--query-access {Disabled, Enabled}]
                                         [--retention-time]
                                         [--workspace]

Examples

Update a component with kind web.

az monitor app-insights component update --app demoApp -k web -g demoRg --retention-time 120

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

--ingestion-access

The public network access type for accessing Application Insights ingestion.

accepted values: Disabled, Enabled
--kind -k

The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of web, ios, other, store, java, phone.

--query-access

The public network access type for accessing Application Insights query.

accepted values: Disabled, Enabled
--retention-time

Retention in days for Application Insights. The value can be one of the following values: 30,60,90,120,180,270,365,550,730. It can be set only when Application Insights is not connected to a Log Analytics workspace.

--workspace

Name or resource ID of a log analytics workspace.

az monitor app-insights component update-tags

Update tags on an existing Application Insights resource.

az monitor app-insights component update-tags --app
                                              --resource-group
                                              --tags

Examples

Update the tag 'name' to equal 'value'.

az monitor app-insights component update-tags --app demoApp --tags name=value -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>.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.