az monitor app-insights component
Note
此參考是 Azure CLI 應用程式 深入解析 延伸模組的一部分(2.71.0 版或更高版本)。 擴充功能會在您第一次執行 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
使用資源標識碼將 AI 連線到 Azure 函式。
az monitor app-insights component connect-function -g myRG -a myAI --function /subscriptions/mySub/resourceGroups/myRG/providers/Microsoft.Web/sites/myFunction
必要參數
Azure 函式的名稱或資源識別碼。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
Application Insights 元件的 GUID、應用程式名稱或完整 Azure 資源名稱。 您可以從 Azure 入口網站中任何 Application Insights 資源上的 API 存取功能表項取得應用程式 GUID。 如果使用應用程式名稱,請指定資源群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | 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
使用資源標識碼將 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 應用程式的名稱或資源識別碼。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
Application Insights 元件的 GUID、應用程式名稱或完整 Azure 資源名稱。 您可以從 Azure 入口網站中任何 Application Insights 資源上的 API 存取功能表項取得應用程式 GUID。 如果使用應用程式名稱,請指定資源群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
擲回例外狀況時啟用快照調試程式。 目前僅支援 .NET/.NET Core Web Apps。
| 屬性 | 值 |
|---|---|
| 接受的值: | false, true |
啟用收集分析追蹤,協助您查看程式代碼中花費的時間。 目前僅支援 .NET/.NET Core Web Apps。
| 屬性 | 值 |
|---|---|
| 接受的值: | false, true |
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | 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>來設定預設群組。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
要監視的應用程式類型。 可能的值包括 『web』、『other』。 預設值為 'web' 。
| 屬性 | 值 |
|---|---|
| 預設值: | web |
用於存取 Application Insights 擷取的公用網路存取類型。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
此元件所參考的應用程式類型,用來自定義UI。 這個值是手繪多邊形字串,值通常應該是其中一個Web、ios、其他、store、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] ...]。使用 「清除現有的標記」。
記錄分析工作區的名稱或資源識別碼。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 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
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
Application Insights 元件的 GUID、應用程式名稱或完整 Azure 資源名稱。 您可以從 Azure 入口網站中任何 Application Insights 資源上的 API 存取功能表項取得應用程式 GUID。 如果使用應用程式名稱,請指定資源群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | 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
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
Application Insights 元件的 GUID、應用程式名稱或完整 Azure 資源名稱。 您可以從 Azure 入口網站中任何 Application Insights 資源上的 API 存取功能表項取得應用程式 GUID。 如果使用應用程式名稱,請指定資源群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | 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
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
Application Insights 元件的 GUID、應用程式名稱或完整 Azure 資源名稱。 您可以從 Azure 入口網站中任何 Application Insights 資源上的 API 存取功能表項取得應用程式 GUID。 如果使用應用程式名稱,請指定資源群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
用於存取 Application Insights 擷取的公用網路存取類型。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
此元件所參考的應用程式類型,用來自定義UI。 這個值是手繪多邊形字串,值通常應該是其中一個Web、ios、其他、store、java、phone。
用於存取 Application Insights 查詢的公用網路存取類型。
| 屬性 | 值 |
|---|---|
| 接受的值: | Disabled, Enabled |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
Application Insights 的保留天數。 此值可以是下列其中一個值:30,60,90,120,180,270,365,550,730。 只有當 Application Insights 未連線到 Log Analytics 工作區時,才能進行設定。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | 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-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] ...]。使用 「清除現有的標記」。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
Application Insights 元件的 GUID、應用程式名稱或完整 Azure 資源名稱。 您可以從 Azure 入口網站中任何 Application Insights 資源上的 API 存取功能表項取得應用程式 GUID。 如果使用應用程式名稱,請指定資源群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |