az monitor autoscale

管理自動調整設定。

命令

名稱 Description 類型 狀態
az monitor autoscale create

建立新的自動調整設定。

核心 GA
az monitor autoscale delete

刪除自動調整設定。

核心 GA
az monitor autoscale list

列出資源群組的自動調整設定。

核心 GA
az monitor autoscale profile

管理自動調整設定檔。

核心 GA
az monitor autoscale profile create

建立固定或週期性的自動調整設定檔。

核心 GA
az monitor autoscale profile delete

刪除自動調整設定檔。

核心 GA
az monitor autoscale profile list

列出自動調整設定檔。

核心 GA
az monitor autoscale profile list-timezones

查閱時區資訊。

核心 GA
az monitor autoscale profile show

顯示自動調整設定檔的詳細資料。

核心 GA
az monitor autoscale rule

管理自動調整調整規則。

核心 GA
az monitor autoscale rule copy

將自動調整規則從一個配置檔案複製到另一個設定檔。

核心 GA
az monitor autoscale rule create

新增自動調整規則。

核心 GA
az monitor autoscale rule delete

從設定檔中移除自動調整規則。

核心 GA
az monitor autoscale rule list

列出設定檔的自動調整規則。

核心 GA
az monitor autoscale show

取得自動調整設定。

核心 GA
az monitor autoscale show-predictive-metric

顯示預測性自動調整計量未來的資料。

核心 GA
az monitor autoscale update

更新自動調整設定。

核心 GA

az monitor autoscale create

建立新的自動調整設定。

如需自動調整的詳細資訊,請流覽: https://docs.microsoft.com/azure/monitoring-and-diagnostics/monitoring-understanding-autoscale-settings

az monitor autoscale create --count
                            --resource
                            [--action]
                            [--disabled {false, true}]
                            [--email-administrator {false, true}]
                            [--email-coadministrators {false, true}]
                            [--location]
                            [--max-count]
                            [--min-count]
                            [--name]
                            [--resource-group]
                            [--resource-namespace]
                            [--resource-parent]
                            [--resource-type]
                            [--scale-look-ahead-time]
                            [--scale-mode {Disabled, Enabled, ForecastOnly}]
                            [--tags]

範例

建立自動調整設定,以在 2 到 5 個實例之間進行調整(預設值為 3)。 發生調整時,請傳送電子郵件給系統管理員。

az monitor autoscale create -g {myrg} --resource {resource-id} --min-count 2 --max-count 5 \
  --count 3 --email-administrator

az monitor autoscale rule create -g {myrg} --autoscale-name {resource-name} --scale out 1 \
  --condition "Percentage CPU > 75 avg 5m"

az monitor autoscale rule create -g {myrg} --autoscale-name {resource-name} --scale in 1 \
  --condition "Percentage CPU < 25 avg 5m"

為正好 4 個實例建立自動調整設定。

az monitor autoscale create -g {myrg} --resource {resource-id} --count 4

建立新的自動調整設定。 (自動產生)

az monitor autoscale create --count 3 --max-count 5 --min-count 2 --name MyAutoscaleSettings --resource myScaleSet --resource-group MyResourceGroup --resource-type Microsoft.Compute/virtualMachineScaleSets

必要參數

--count

要使用的實例數。 如果使用 --min/max-count,則要使用的實例預設數目。

--resource

目標資源的名稱或識別碼。

選擇性參數

--action -a

新增動作,以在發生縮放事件時引發。

使用方式:-action TYPE KEY [ARG ...]電子郵件: --action email bob@contoso.comann@contoso.com Webhook: --action webhook https://www.contoso.com/alert apiKey=value Webhook: --action Webhook https://www.contoso.com/alert?apiKey=value 多個動作可以使用多個 --action 引數來指定。

--disabled

建立處於停用狀態的自動調整設定。

接受的值: false, true
--email-administrator

在調整規模時傳送電子郵件給訂用帳戶管理員。

接受的值: false, true
--email-coadministrators

傳送電子郵件給訂用帳戶共同管理員,以調整規模。

接受的值: false, true
--location -l

位置。​​ 來自的值: az account list-locations 。 您可以使用 來設定預設位置 az configure --defaults location=<location>

--max-count

實例數目上限。

--min-count

實例數目下限。

--name -n

自動調整設定的名稱。

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--resource-namespace

目標資源提供者命名空間。

--resource-parent

如果適用,則以資源父路徑為目標。

--resource-type

目標資源類型。 也可以接受命名空間/類型格式(例如:'Microsoft.Compute/virtualMachines')。

--scale-look-ahead-time

指定要事先啟動實例的時間量。 它必須是 ISO 8601 格式的 1 分鐘到 60 分鐘(例如,100 天會是 P100D)。

--scale-mode

預測性自動調整模式。

接受的值: Disabled, Enabled, ForecastOnly
--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「」 清除現有的標記。

全域參數
--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 autoscale delete

刪除自動調整設定。

az monitor autoscale delete [--autoscale-name]
                            [--ids]
                            [--resource-group]
                            [--subscription]

選擇性參數

--autoscale-name --name -n

自動調整設定名稱。

--ids

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

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--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 autoscale list

列出資源群組的自動調整設定。

az monitor autoscale list --resource-group
                          [--max-items]
                          [--next-token]

必要參數

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--max-items

命令輸出中要傳回的專案總數。 如果可用的專案總數超過指定的值,則會在命令的輸出中提供權杖。 若要繼續分頁,請在後續命令的引數中 --next-token 提供權杖值。

--next-token

標記,指定要開始分頁的位置。 這是先前截斷回應中的權杖值。

全域參數
--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 autoscale show

取得自動調整設定。

az monitor autoscale show [--autoscale-name]
                          [--ids]
                          [--resource-group]
                          [--subscription]

範例

顯示自動調整設定詳細資料。

az monitor autoscale show --name MyAutoscaleSettings --resource-group MyResourceGroup

選擇性參數

--autoscale-name --name -n

自動調整設定名稱。

--ids

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

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--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 autoscale show-predictive-metric

顯示預測性自動調整計量未來的資料。

az monitor autoscale show-predictive-metric --aggregation
                                            --interval
                                            --metric-name
                                            --metric-namespace
                                            --timespan
                                            [--autoscale-setting-name]
                                            [--ids]
                                            [--resource-group]
                                            [--subscription]

必要參數

--aggregation

要擷取的匯總類型清單(逗號分隔)。

--interval

查詢的間隔 (亦即 timegrain)。

--metric-name

要擷取的計量名稱(逗號分隔)。 特殊情況:如果 metricname 本身有逗號,請使用 %2 來表示它。 例如:'Metric,Name1' 應該是 'Metric%2Name1'

--metric-namespace

要查詢計量定義的計量命名空間。

--timespan

查詢的時間範圍。 它是具有下列格式 'startDateTime_ISO/endDateTime_ISO' 的字串。

選擇性參數

--autoscale-setting-name

自動調整設定名稱。

--ids

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

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--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 autoscale update

更新自動調整設定。

如需自動調整的詳細資訊,請流覽: https://docs.microsoft.com/azure/monitoring-and-diagnostics/monitoring-understanding-autoscale-settings

az monitor autoscale update [--add]
                            [--add-action]
                            [--autoscale-name]
                            [--count]
                            [--email-administrator {0, 1, f, false, n, no, t, true, y, yes}]
                            [--email-coadministrators {0, 1, f, false, n, no, t, true, y, yes}]
                            [--enabled {0, 1, f, false, n, no, t, true, y, yes}]
                            [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                            [--ids]
                            [--max-count]
                            [--min-count]
                            [--remove]
                            [--remove-action]
                            [--resource-group]
                            [--scale-look-ahead-time]
                            [--scale-mode {Disabled, Enabled, ForecastOnly}]
                            [--set]
                            [--subscription]
                            [--tags]

範例

更新自動調整設定,以預設使用固定的 3 個實例。

az monitor autoscale update -g myrg -n autoscale-name --count 3

更新自動調整設定以移除電子郵件通知。

az monitor autoscale update -g myrg -n autoscale-name \ --remove-action email bob@contoso.com

更新自動調整設定。

az monitor autoscale update --count 3 --email-administrator true --enabled true --max-count 5 --min-count 2 --name MyAutoscaleSettings --resource-group MyResourceGroup --tags key[=value]

選擇性參數

--add

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

--add-action --add-actions -a

新增動作,以在發生縮放事件時引發。 使用方式:--add-action TYPE KEY [ARG ...]電子郵件:--add-action 電子郵件 bob@contoso.comann@contoso.com Webhook: --add-action Webhook https://www.contoso.com/alert apiKey=value Webhook: --add-action Webhook https://www.contoso.com/alert?apiKey=value 多個動作可以使用多個 --add-action 引數來指定。 支援速記語法、json-file 和 yaml-file。 請嘗試 「??」 以顯示更多。

--autoscale-name --name -n

自動調整設定名稱。

--count

要使用的實例數。 如果使用 --min/max-count,則要使用的實例預設數目。

--email-administrator

在調整規模時傳送電子郵件給訂用帳戶管理員。

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

傳送電子郵件給訂用帳戶共同管理員,以調整規模。

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

已啟用的旗標。 指定是否為資源啟用自動調整。 預設值為 'false'。

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

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

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

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

--max-count

實例數目上限。

--min-count

實例數目下限。

--remove

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

--remove-action --remove-actions -r

移除一或多個動作。 使用方式:--remove-action TYPE KEY [KEY ...]電子郵件:--remove-action 電子郵件 bob@contoso.comann@contoso.com Webhook:--remove-action Webhook https://contoso.com/alerthttps://alerts.contoso.com 。 支援速記語法、json-file 和 yaml-file。 請嘗試 「??」 以顯示更多。

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--scale-look-ahead-time

指定要事先啟動實例的時間量。 它必須是 ISO 8601 格式的 1 分鐘到 60 分鐘(例如,100 天會是 P100D)。

--scale-mode

預測性自動調整模式。

接受的值: Disabled, Enabled, ForecastOnly
--set

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

--subscription

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

--tags

取得或設定用以描述資源的索引鍵/值組清單。 這些標籤可用於檢視和群組此資源(跨資源群組)。 最多可為資源提供 15 個標籤。 每個標記的長度必須不超過 128 個字元,且長度不超過 256 個字元的值。 支援速記語法、json-file 和 yaml-file。 請嘗試 「??」 以顯示更多。

全域參數
--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 來取得完整偵錯記錄。