diff --git a/src/azure-cli/HISTORY.rst b/src/azure-cli/HISTORY.rst index 9579a9a5f9e..7a9769384ca 100644 --- a/src/azure-cli/HISTORY.rst +++ b/src/azure-cli/HISTORY.rst @@ -30,6 +30,7 @@ Release History * Fix `vm create` failure in Azure Stack profile. * vm monitor metrics tail/list-definitions: support query metric and list definitions for a vm. +* Add new reapply command action for az vm **Storage** diff --git a/src/azure-cli/azure/cli/command_modules/vm/_help.py b/src/azure-cli/azure/cli/command_modules/vm/_help.py index f00466ea400..944f97988f8 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_help.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_help.py @@ -1606,6 +1606,18 @@ """ +helps['vm reapply'] = """ +type: command +short-summary: Reapply VMs. +examples: + - name: Reapply a VM. + text: az vm reapply -g MyResourceGroup -n MyVm + - name: Reapply all VMs in a resource group. + text: > + az vm reapply --ids $(az vm list -g MyResourceGroup --query "[].id" -o tsv) + +""" + helps['vm redeploy'] = """ type: command short-summary: Redeploy an existing VM. diff --git a/src/azure-cli/azure/cli/command_modules/vm/commands.py b/src/azure-cli/azure/cli/command_modules/vm/commands.py index ed6fd5a2694..00f8e696d5b 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/commands.py +++ b/src/azure-cli/azure/cli/command_modules/vm/commands.py @@ -272,6 +272,7 @@ def load_command_table(self, _): g.custom_show_command('show', 'show_vm', table_transformer=transform_vm) g.command('start', 'start', supports_no_wait=True) g.command('stop', 'power_off', supports_no_wait=True, validator=process_vm_vmss_stop) + g.command('reapply', 'reapply', supports_no_wait=True, min_api='2019-07-01') g.generic_update_command('update', setter_name='update_vm', setter_type=compute_custom, supports_no_wait=True) g.wait_command('wait', getter_name='get_instance_view', getter_type=compute_custom)