az monitor app-insights component
Note
此参考是 Azure CLI(版本 2.71.0 或更高版本) 的 application-insights 扩展的一部分。 该扩展会在首次运行 az monitor app-insights 组件 命令时自动安装。 了解更多关于扩展的信息。
管理 Application Insights 组件或其子组件。
命令
az monitor app-insights component connect-function
将 AI 连接到 Azure 函数。
az monitor app-insights component connect-function --function
[--app]
[--ids]
[--resource-group]
[--subscription]
示例
将 AI 连接到 Azure 函数。
az monitor app-insights component connect-function -g myRG -a myAI --function myFunction
使用资源 ID 将 AI 连接到 Azure 函数。
az monitor app-insights component connect-function -g myRG -a myAI --function /subscriptions/mySub/resourceGroups/myRG/providers/Microsoft.Web/sites/myFunction
必需参数
Azure 函数的名称或资源 ID。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Application Insights 组件的 GUID、应用名称或完全限定的 Azure 资源名称。 可以从 Azure 门户中任何 Application Insights 资源上的 API 访问菜单项获取应用程序 GUID。 如果使用应用程序名称,请指定资源组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az monitor app-insights component connect-webapp
将 AI 连接到 Web 应用。
az monitor app-insights component connect-webapp --web-app
[--app]
[--enable-debugger --enable-snapshot-debugger {false, true}]
[--enable-profiler {false, true}]
[--ids]
[--resource-group]
[--subscription]
示例
将 AI 连接到 Web 应用,并为 Web 应用启用探查器和快照调试器。
az monitor app-insights component connect-webapp -g myRG -a myAI --web-app myApp --enable-profiler --enable-snapshot-debugger
使用资源 ID 将 AI 连接到 Web 应用,并启用探查器并为 Web 应用禁用快照调试器。
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
必需参数
Web 应用的名称或资源 ID。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Application Insights 组件的 GUID、应用名称或完全限定的 Azure 资源名称。 可以从 Azure 门户中任何 Application Insights 资源上的 API 访问菜单项获取应用程序 GUID。 如果使用应用程序名称,请指定资源组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
引发异常时启用快照调试器。 目前,它仅支持 .NET/.NET Core Web 应用。
属性 | 值 |
---|---|
接受的值: | false, true |
启用收集分析跟踪,以帮助查看代码中花费的时间。 目前,它仅支持 .NET/.NET Core Web 应用。
属性 | 值 |
---|---|
接受的值: | false, true |
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az monitor app-insights component create
新建 Application Insights 资源。
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]
示例
创建具有类型 Web 和位置的组件。
az monitor app-insights component create --app demoApp --location westus2 --kind web -g demoRg --application-type web --retention-time 120
必需参数
Application Insights 组件的 GUID、应用名称或完全限定的 Azure 资源名称。 可以从 Azure 门户中任何 Application Insights 资源上的 API 访问菜单项获取应用程序 GUID。 如果使用应用程序名称,请指定资源组。
Location.
az account list-locations
中的值。 可以使用 az configure --defaults location=<location>
配置默认位置。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
正在监视的应用程序的类型。 可能的值包括“web”、“other”。 默认值为“web”。
属性 | 值 |
---|---|
默认值: | web |
用于访问 Application Insights 引入的公共网络访问类型。
属性 | 值 |
---|---|
接受的值: | Disabled, Enabled |
此组件引用的应用程序类型,用于自定义 UI。 此值是一个任意多边形字符串,值通常应为 Web、ios、其他、存储、java、phone 之一。
属性 | 值 |
---|---|
默认值: | web |
用于访问 Application Insights 查询的公共网络访问类型。
属性 | 值 |
---|---|
接受的值: | Disabled, Enabled |
Application Insights 保留天数。 该值可以是下列值之一:30,60,90,120,180,270,365,550,730。 仅当 Application Insights 未连接到 Log Analytics 工作区时,才能设置它。
空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。
Log Analytics 工作区的名称或资源 ID。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az monitor app-insights component delete
删除新的 Application Insights 资源。
az monitor app-insights component delete [--app]
[--ids]
[--resource-group]
[--subscription]
示例
删除具有类型 Web 和位置的组件。
az monitor app-insights component delete --app demoApp -g demoRg
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Application Insights 组件的 GUID、应用名称或完全限定的 Azure 资源名称。 可以从 Azure 门户中任何 Application Insights 资源上的 API 访问菜单项获取应用程序 GUID。 如果使用应用程序名称,请指定资源组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az monitor app-insights component show
获取 Application Insights 资源。
az monitor app-insights component show [--app]
[--ids]
[--resource-group]
[--subscription]
示例
按名称获取组件。
az monitor app-insights component show --app demoApp -g demoRg
列出资源组中的组件。
az monitor app-insights component show -g demoRg
列出当前所选订阅中的组件。
az monitor app-insights component show
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Application Insights 组件的 GUID、应用名称或完全限定的 Azure 资源名称。 可以从 Azure 门户中任何 Application Insights 资源上的 API 访问菜单项获取应用程序 GUID。 如果使用应用程序名称,请指定资源组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az monitor app-insights component update
更新现有 Application Insights 资源的属性。 可以更新的主要值是类型,用于自定义 UI 体验。
az monitor app-insights component update [--app]
[--ids]
[--ingestion-access {Disabled, Enabled}]
[--kind]
[--query-access {Disabled, Enabled}]
[--resource-group]
[--retention-time]
[--subscription]
[--workspace]
示例
使用类型 Web 更新组件。
az monitor app-insights component update --app demoApp -k web -g demoRg --retention-time 120
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Application Insights 组件的 GUID、应用名称或完全限定的 Azure 资源名称。 可以从 Azure 门户中任何 Application Insights 资源上的 API 访问菜单项获取应用程序 GUID。 如果使用应用程序名称,请指定资源组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
用于访问 Application Insights 引入的公共网络访问类型。
属性 | 值 |
---|---|
接受的值: | Disabled, Enabled |
此组件引用的应用程序类型,用于自定义 UI。 此值是一个任意多边形字符串,值通常应为 Web、ios、其他、存储、java、phone 之一。
用于访问 Application Insights 查询的公共网络访问类型。
属性 | 值 |
---|---|
接受的值: | Disabled, Enabled |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
Application Insights 保留天数。 该值可以是下列值之一:30,60,90,120,180,270,365,550,730。 仅当 Application Insights 未连接到 Log Analytics 工作区时,才能设置它。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
Log Analytics 工作区的名称或资源 ID。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az monitor app-insights component update-tags
更新现有 Application Insights 资源的标记。
az monitor app-insights component update-tags --tags
[--app]
[--ids]
[--resource-group]
[--subscription]
示例
将标记“name”更新为等于“value”。
az monitor app-insights component update-tags --app demoApp --tags name=value -g demoRg
必需参数
空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Application Insights 组件的 GUID、应用名称或完全限定的 Azure 资源名称。 可以从 Azure 门户中任何 Application Insights 资源上的 API 访问菜单项获取应用程序 GUID。 如果使用应用程序名称,请指定资源组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
输出格式。
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |