From d6c005389e207161ee93f9327a6e65212a3cf469 Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Thu, 16 Apr 2026 06:41:37 +0000 Subject: [PATCH] [MONITOR] Improve help documentation for 5 commands --- .../cli/command_modules/monitor/_help.py | 60 ++++++++++++++----- 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/monitor/_help.py b/src/azure-cli/azure/cli/command_modules/monitor/_help.py index f4d9cab1956..c3752dab6a6 100644 --- a/src/azure-cli/azure/cli/command_modules/monitor/_help.py +++ b/src/azure-cli/azure/cli/command_modules/monitor/_help.py @@ -34,10 +34,17 @@ helps['monitor activity-log alert list'] = """ type: command -short-summary: List activity log alert rules under a resource group or the current subscription. +short-summary: List activity log alert rules within a resource group or across the current subscription. parameters: - name: --resource-group -g - short-summary: Name of the resource group under which the activity log alert rules are being listed. If it is omitted, all the activity log alert rules under the current subscription are listed. + short-summary: Specify the name of the resource group to list activity log alert rules. If omitted, lists all alert rules in the current subscription. +examples: + - name: List activity log alert rules in a specific resource group + text: | + az monitor activity-log alert list --resource-group myResourceGroup + - name: List all activity log alert rules in the current subscription + text: | + az monitor activity-log alert list """ helps['monitor activity-log list'] = """ @@ -85,12 +92,12 @@ helps['monitor autoscale create'] = """ type: command -short-summary: Create new autoscale settings. +short-summary: Create new autoscale settings for a target resource. long-summary: > - For more information on autoscaling, visit: https://learn.microsoft.com/azure/monitoring-and-diagnostics/monitoring-understanding-autoscale-settings + For more information on autoscaling and its configuration, visit: https://learn.microsoft.com/azure/monitoring-and-diagnostics/monitoring-understanding-autoscale-settings parameters: - name: --action -a - short-summary: Add an action to fire when a scaling event occurs. + short-summary: Specify an action to trigger when a scaling event occurs. long-summary: | Usage: --action TYPE KEY [ARG ...] Email: --action email bob@contoso.com ann@contoso.com @@ -98,20 +105,20 @@ Webhook: --action webhook https://www.contoso.com/alert?apiKey=value Multiple actions can be specified by using more than one `--action` argument. examples: - - name: Create autoscale settings to scale between 2 and 5 instances (3 as default). Email the administrator when scaling occurs. + - name: Create autoscale settings to scale between 2 and 5 instances with 3 as the default. Notify the administrator via email when scaling occurs. text: | - az monitor autoscale create -g {myrg} --resource {resource-id} --min-count 2 --max-count 5 \\ + 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 \\ + 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 \\ + az monitor autoscale rule create -g {myrg} --autoscale-name {resource-name} --scale in 1 \ --condition "Percentage CPU < 25 avg 5m" - - name: Create autoscale settings for exactly 4 instances. + - name: Create autoscale settings to maintain a constant 4 instances. text: > az monitor autoscale create -g {myrg} --resource {resource-id} --count 4 - - name: Create new autoscale settings. (autogenerated) + - name: Create new autoscale settings with specified scales. (autogenerated) text: | az monitor autoscale create --count 3 --max-count 5 --min-count 2 --name MyAutoscaleSettings --resource myScaleSet --resource-group MyResourceGroup --resource-type Microsoft.Compute/virtualMachineScaleSets crafted: true @@ -210,12 +217,35 @@ helps['monitor autoscale profile list-timezones'] = """ type: command -short-summary: Look up time zone information. +short-summary: List available time zones for autoscale profiles. +parameters: + - name: --offset + short-summary: Filter time zones by UTC hour offset. + - name: --search-query -q + short-summary: Search for time zones matching the query text. +examples: + - name: List all time zones. + text: az monitor autoscale profile list-timezones + - name: List time zones with UTC+3 offset. + text: az monitor autoscale profile list-timezones --offset 3 + - name: Search for time zones containing 'Pacific'. + text: az monitor autoscale profile list-timezones --search-query "Pacific" """ helps['monitor autoscale profile show'] = """ type: command -short-summary: Show details of an autoscale profile. +short-summary: Display the details of a specified autoscale profile. +parameters: + - name: --autoscale-name + short-summary: Name of the autoscale settings. + - name: --resource-group -g + short-summary: Name of the resource group. Configure the default group using `az configure --defaults group=`. + - name: --name -n + short-summary: Name of the autoscale profile. +examples: + - name: Show details of an autoscale profile + text: | + az monitor autoscale profile show --autoscale-name myAutoscaleSettings --resource-group myResourceGroup --name myProfileName """ helps['monitor autoscale rule'] = """ @@ -619,9 +649,9 @@ helps['monitor clone'] = """ type: command -short-summary: Clone metrics alert rules from one resource to another resource. +short-summary: Clone metric alert rules from one Azure resource to another. examples: - - name: Clone the metric alert settings from one VM to another + - name: Clone metric alert settings between two VMs text: | az monitor clone --source-resource /subscriptions/{subscriptionID}/resourceGroups/Space1999/providers/Microsoft.Compute/virtualMachines/vm1 --target-resource /subscriptions/{subscriptionID}/resourceGroups/Space1999/providers/Microsoft.Compute/virtualMachines/vm2 """