az monitor autoscale
管理自動調整設定。
命令
| 名稱 | Description | 類型 | 狀態 |
|---|---|---|---|
| az monitor autoscale create |
建立新的自動調整設定。 |
Core | GA |
| az monitor autoscale delete |
刪除自動調整設定。 |
Core | GA |
| az monitor autoscale list |
列出資源群組的自動調整設定。 |
Core | GA |
| az monitor autoscale profile |
管理自動調整配置檔。 |
Core | GA |
| az monitor autoscale profile create |
建立固定或週期性的自動調整配置檔。 |
Core | GA |
| az monitor autoscale profile delete |
刪除自動調整配置檔。 |
Core | GA |
| az monitor autoscale profile list |
列出自動調整配置檔。 |
Core | GA |
| az monitor autoscale profile list-timezones |
查閱時區資訊。 |
Core | GA |
| az monitor autoscale profile show |
顯示自動調整配置檔的詳細數據。 |
Core | GA |
| az monitor autoscale rule |
管理自動調整調整規則。 |
Core | GA |
| az monitor autoscale rule copy |
將自動調整規則從一個配置檔複製到另一個配置檔。 |
Core | GA |
| az monitor autoscale rule create |
新增自動調整規則。 |
Core | GA |
| az monitor autoscale rule delete |
從配置檔中移除自動調整規則。 |
Core | GA |
| az monitor autoscale rule list |
列出配置檔的自動調整規則。 |
Core | GA |
| az monitor autoscale show |
取得自動調整設定。 |
Core | GA |
| az monitor autoscale show-predictive-metric |
顯示預測性自動調整計量未來的數據。 |
Core | GA |
| az monitor autoscale update |
更新自動調整設定。 |
Core | GA |
az monitor autoscale create
建立新的自動調整設定。
如需自動調整的詳細資訊,請瀏覽:https://learn.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
建立新的自動調整設定。 (autogenerated)
az monitor autoscale create --count 3 --max-count 5 --min-count 2 --name MyAutoscaleSettings --resource myScaleSet --resource-group MyResourceGroup --resource-type Microsoft.Compute/virtualMachineScaleSets
必要參數
要使用的實例數。 如果使用 --min/max-count,則要使用的實例預設數目。
| 屬性 | 值 |
|---|---|
| 參數群組: | Instance Limit Arguments |
目標資源的名稱或識別碼。
| 屬性 | 值 |
|---|---|
| 參數群組: | Target Resource Arguments |
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
新增動作,以在發生縮放事件時引發。
使用方式:-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 自變數來指定。
| 屬性 | 值 |
|---|---|
| 參數群組: | Notification Arguments |
建立處於停用狀態的自動調整設定。
| 屬性 | 值 |
|---|---|
| 接受的值: | false, true |
在調整規模時傳送電子郵件給訂用帳戶管理員。
| 屬性 | 值 |
|---|---|
| 參數群組: | Notification Arguments |
| 接受的值: | false, true |
傳送電子郵件給訂用帳戶共同管理員,以調整規模。
| 屬性 | 值 |
|---|---|
| 參數群組: | Notification Arguments |
| 接受的值: | false, true |
Location. 值的來源:az account list-locations。 您可以使用 az configure --defaults location=<location>來設定預設位置。
實例數目上限。
| 屬性 | 值 |
|---|---|
| 參數群組: | Instance Limit Arguments |
實例數目下限。
| 屬性 | 值 |
|---|---|
| 參數群組: | Instance Limit Arguments |
自動調整設定的名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Target Resource Arguments |
目標資源提供者命名空間。
| 屬性 | 值 |
|---|---|
| 參數群組: | Target Resource Arguments |
如果適用,則以資源父路徑為目標。
| 屬性 | 值 |
|---|---|
| 參數群組: | Target Resource Arguments |
目標資源類型。 也可以接受命名空間/類型格式(例如:『Microsoft.Compute/virtualMachines』)。
| 屬性 | 值 |
|---|---|
| 參數群組: | Target Resource Arguments |
指定要事先啟動實例的時間量。 它必須是 ISO 8601 格式的 1 分鐘到 60 分鐘(例如,100 天會是 P100D)。
| 屬性 | 值 |
|---|---|
| 參數群組: | Predictive Policy Arguments |
預測性自動調整模式。
| 屬性 | 值 |
|---|---|
| 參數群組: | Predictive Policy Arguments |
| 接受的值: | Disabled, Enabled, ForecastOnly |
以空格分隔的標記: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 autoscale delete
刪除自動調整設定。
az monitor autoscale delete [--autoscale-name --name]
[--ids]
[--resource-group]
[--subscription]
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
自動調整設定名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | 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 autoscale list
列出資源群組的自動調整設定。
az monitor autoscale list --resource-group
[--max-items]
[--next-token]
必要參數
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
命令輸出中要傳回的項目總數。 如果可用的專案總數超過指定的值,則會在命令的輸出中提供令牌。 若要繼續分頁,請在後續命令的 --next-token 自變數中提供令牌值。
| 屬性 | 值 |
|---|---|
| 參數群組: | Pagination Arguments |
標記,指定要開始分頁的位置。 這是先前截斷回應中的令牌值。
| 屬性 | 值 |
|---|---|
| 參數群組: | Pagination Arguments |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | 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 autoscale show
取得自動調整設定。
az monitor autoscale show [--autoscale-name --name]
[--ids]
[--resource-group]
[--subscription]
範例
顯示自動調整設定詳細數據。
az monitor autoscale show --name MyAutoscaleSettings --resource-group MyResourceGroup
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
自動調整設定名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | 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 autoscale show-predictive-metric
顯示預測性自動調整計量未來的數據。
az monitor autoscale show-predictive-metric --aggregation
--interval
--metric-name
--metric-namespace
--timespan
[--autoscale-setting-name]
[--ids]
[--resource-group]
[--subscription]
必要參數
要擷取的匯總類型清單(逗號分隔)。
查詢的間隔 (亦即 timegrain)。
要擷取的計量名稱(逗號分隔)。 特殊案例:如果 metricname 本身有逗號,請使用 %2 來指出它。 例如:'Metric,Name1' 應該是 'Metric%2Name1'。
要查詢計量定義的計量命名空間。
查詢的時間範圍。 它是具有下列格式 『startDateTime_ISO/endDateTime_ISO』 的字串。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
自動調整設定名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | 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 autoscale update
更新自動調整設定。
如需自動調整的詳細資訊,請瀏覽:https://learn.microsoft.com/azure/monitoring-and-diagnostics/monitoring-understanding-autoscale-settings。
az monitor autoscale update [--add]
[--add-action --add-actions]
[--autoscale-name --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 --remove-actions]
[--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 property.listProperty <key=value, string or JSON string>.
| 屬性 | 值 |
|---|---|
| 參數群組: | Generic Update Arguments |
新增動作,以在發生縮放事件時引發。
使用方式:--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。 請嘗試 “??” 以顯示更多。
| 屬性 | 值 |
|---|---|
| 參數群組: | Notification Arguments |
自動調整設定名稱。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
要使用的實例數。 如果使用 --min/max-count,則要使用的實例預設數目。
| 屬性 | 值 |
|---|---|
| 參數群組: | Instance Limit Arguments |
在調整規模時傳送電子郵件給訂用帳戶管理員。
| 屬性 | 值 |
|---|---|
| 參數群組: | Notification Arguments |
| 接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
傳送電子郵件給訂用帳戶共同管理員,以調整規模。
| 屬性 | 值 |
|---|---|
| 參數群組: | Notification Arguments |
| 接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
已啟用的旗標。 指定是否為資源啟用自動調整。 默認值為 『false』。
| 屬性 | 值 |
|---|---|
| 接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。
| 屬性 | 值 |
|---|---|
| 參數群組: | Generic Update Arguments |
| 接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
一或多個資源識別碼(以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
實例數目上限。
| 屬性 | 值 |
|---|---|
| 參數群組: | Instance Limit Arguments |
實例數目下限。
| 屬性 | 值 |
|---|---|
| 參數群組: | Instance Limit Arguments |
從清單中移除屬性或專案。 範例: --remove property.list <indexToRemove> 或 --remove propertyToRemove。
| 屬性 | 值 |
|---|---|
| 參數群組: | Generic Update Arguments |
拿掉一或多個動作。
使用方式:--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。 請嘗試 “??” 以顯示更多。
| 屬性 | 值 |
|---|---|
| 參數群組: | Notification Arguments |
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
指定要事先啟動實例的時間量。 它必須是 ISO 8601 格式的 1 分鐘到 60 分鐘(例如,100 天會是 P100D)。
| 屬性 | 值 |
|---|---|
| 參數群組: | Predictive Policy Arguments |
預測性自動調整模式。
| 屬性 | 值 |
|---|---|
| 參數群組: | Predictive Policy Arguments |
| 接受的值: | Disabled, Enabled, ForecastOnly |
指定要設定的屬性路徑和值,以更新物件。 範例: --set property1.property2=<value>.
| 屬性 | 值 |
|---|---|
| 參數群組: | Generic Update Arguments |
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
| 屬性 | 值 |
|---|---|
| 參數群組: | Resource Id Arguments |
取得或設定描述資源的索引鍵值組清單。 這些標籤可用於檢視和群組此資源(跨資源群組)。 最多可為資源提供15個標籤。 每個標記的長度必須不超過 128 個字元,且長度不超過 256 個字元的值。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |