az monitor diagnostic-settings subscription

管理訂用帳戶的診斷設定。

命令

名稱 Description 類型 狀態
az monitor diagnostic-settings subscription create

建立指定資源的訂用帳戶診斷設定。

核心 GA
az monitor diagnostic-settings subscription delete

刪除指定資源的現有訂用帳戶診斷設定。

核心 GA
az monitor diagnostic-settings subscription list

取得指定 subscriptionId 的作用中訂用帳戶診斷設定清單。 :keyword 可呼叫 cls:將傳遞直接回應的自訂類型或函式:return:SubscriptionDiagnostic設定ResourceCollection 或 cls(response):rtype: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnostic設定ResourceCollection:raises ~azure.core.exceptions.HttpResponseError:。

核心 GA
az monitor diagnostic-settings subscription show

取得指定資源的使用中訂用帳戶診斷設定。

核心 GA
az monitor diagnostic-settings subscription update

更新指定資源的訂用帳戶診斷設定。

核心 GA

az monitor diagnostic-settings subscription create

建立指定資源的訂用帳戶診斷設定。

az monitor diagnostic-settings subscription create --name
                                                   [--event-hub-auth-rule]
                                                   [--event-hub-name]
                                                   [--location]
                                                   [--logs]
                                                   [--service-bus-rule]
                                                   [--storage-account]
                                                   [--workspace]

範例

使用 EventHub 建立訂用帳戶的診斷設定。

az monitor diagnostic-settings subscription create -n {name} --location westus --event-hub- auth-rule {eventHubRuleID} --storage-account {storageAccount} \ --logs "[{category:Security,enabled:true},{category:Administrative,enabled:true},{category:ServiceHealth,enabled:true},{category:Alert,enabled:true},{category:Recommendation,enabled:true},{category:Policy,enabled:true},{category:Autoscale,enabled:true},{category:ResourceHealth,enabled:true}]"

必要參數

--name -n

診斷設定的名稱。

選擇性參數

--event-hub-auth-rule

事件中樞授權規則的資源識別碼。

--event-hub-name

事件中樞的名稱。 如果未指定任何專案,則會選取預設事件中樞。

--location -l

資源的位置。

--logs

記錄設定的 JSON 編碼清單。 使用 '@{file}' 從檔案載入。 支援速記語法、json-file 和 yaml-file。 請嘗試 「??」 以顯示更多。

--service-bus-rule

您想要在其中建立事件中樞以串流活動記錄的服務匯流排命名空間服務匯流排規則識別碼。 規則識別碼的格式為 '{service bus resourceID}/authorizationrules/{key name}'。

--storage-account

您要傳送活動記錄的儲存體帳戶資源識別碼。

--workspace

Log Analytics 工作區的資源識別碼。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az monitor diagnostic-settings subscription delete

刪除指定資源的現有訂用帳戶診斷設定。

az monitor diagnostic-settings subscription delete [--ids]
                                                   [--name]
                                                   [--subscription]
                                                   [--yes]

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源識別碼」引數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

診斷設定的名稱。

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--yes -y

不提示確認。

預設值: False
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az monitor diagnostic-settings subscription list

取得指定 subscriptionId 的作用中訂用帳戶診斷設定清單。 :keyword 可呼叫 cls:將傳遞直接回應的自訂類型或函式:return:SubscriptionDiagnostic設定ResourceCollection 或 cls(response):rtype: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnostic設定ResourceCollection:raises ~azure.core.exceptions.HttpResponseError:。

az monitor diagnostic-settings subscription list
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az monitor diagnostic-settings subscription show

取得指定資源的使用中訂用帳戶診斷設定。

az monitor diagnostic-settings subscription show [--ids]
                                                 [--name]
                                                 [--subscription]

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源識別碼」引數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

診斷設定的名稱。

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az monitor diagnostic-settings subscription update

更新指定資源的訂用帳戶診斷設定。

az monitor diagnostic-settings subscription update [--add]
                                                   [--event-hub-auth-rule]
                                                   [--event-hub-name]
                                                   [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                                   [--ids]
                                                   [--location]
                                                   [--logs]
                                                   [--name]
                                                   [--remove]
                                                   [--service-bus-rule]
                                                   [--set]
                                                   [--storage-account]
                                                   [--subscription]
                                                   [--workspace]

選擇性參數

--add

藉由指定路徑和索引鍵值組,將 物件加入物件清單。 範例:--add property.listProperty < key=value、string 或 JSON 字串 > 。

--event-hub-auth-rule

事件中樞授權規則的資源識別碼。

--event-hub-name

事件中樞的名稱。 如果未指定任何專案,則會選取預設事件中樞。

--force-string

使用 'set' 或 'add' 時,請保留字元串常值,而不是嘗試轉換成 JSON。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源識別碼」引數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」引數。

--location -l

資源的位置。

--logs

記錄設定的 JSON 編碼清單。 使用 '@{file}' 從檔案載入。 支援速記語法、json-file 和 yaml-file。 請嘗試 「??」 以顯示更多。

--name -n

診斷設定的名稱。

--remove

從清單中移除屬性或專案。 範例:--remove property.list OR --remove 屬性ToRemove。

--service-bus-rule

您想要在其中建立事件中樞以串流活動記錄的服務匯流排命名空間服務匯流排規則識別碼。 規則識別碼的格式為 '{service bus resourceID}/authorizationrules/{key name}'。

--set

指定要設定的屬性路徑和值,以更新物件。 範例:--set property1.property2=。

--storage-account

您要傳送活動記錄的儲存體帳戶資源識別碼。

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--workspace

Log Analytics 工作區的資源識別碼。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。