az vmss
Manage groupings of virtual machines in an Azure Virtual Machine Scale Set (VMSS).
Commands
az vmss create |
Create an Azure Virtual Machine Scale Set. |
az vmss deallocate |
Deallocate VMs within a VMSS. |
az vmss delete |
Deletes a VM scale set. |
az vmss delete-instances |
Delete VMs within a VMSS. |
az vmss diagnostics |
Configure the Azure Virtual Machine Scale Set diagnostics extension. |
az vmss diagnostics get-default-config |
Show the default config file which defines data to be collected. |
az vmss diagnostics set |
Enable diagnostics on a VMSS. |
az vmss disk |
Manage data disks of a VMSS. |
az vmss disk attach |
Attach managed data disks to a scale set or its instances. |
az vmss disk detach |
Detach managed data disks from a scale set or its instances. |
az vmss encryption |
Manage encryption of VMSS. |
az vmss encryption disable |
Disable the encryption on a VMSS with managed disks. |
az vmss encryption enable |
Encrypt a VMSS with managed disks. |
az vmss encryption show |
Show encryption status. |
az vmss extension |
Manage extensions on a VM scale set. |
az vmss extension delete |
Delete an extension from a VMSS. |
az vmss extension image |
Find the available VM extensions for a subscription and region. |
az vmss extension image list |
List the information on available extensions. |
az vmss extension image list-names |
Gets a list of virtual machine extension image types. |
az vmss extension image list-versions |
Gets a list of virtual machine extension image versions. |
az vmss extension image show |
Gets a virtual machine extension image. |
az vmss extension list |
List extensions associated with a VMSS. |
az vmss extension set |
Add an extension to a VMSS or update an existing extension. |
az vmss extension show |
Show details on a VMSS extension. |
az vmss get-instance-view |
View an instance of a VMSS. |
az vmss get-os-upgrade-history |
Gets list of OS upgrades on a VM scale set instance. |
az vmss list |
List VMSS. |
az vmss list-instance-connection-info |
Get the IP address and port number used to connect to individual VM instances within a set. |
az vmss list-instance-public-ips |
List public IP addresses of VM instances within a set. |
az vmss list-instances |
Gets a list of all virtual machines in a VM scale sets. |
az vmss list-skus |
Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU. |
az vmss nic |
Manage network interfaces of a VMSS. |
az vmss nic list |
Gets all network interfaces in a virtual machine scale set. |
az vmss nic list-vm-nics |
Gets information about all network interfaces in a virtual machine in a virtual machine scale set. |
az vmss nic show |
Get the specified network interface in a virtual machine scale set. |
az vmss perform-maintenance |
Perform maintenance on one or more virtual machines in a VM scale set. |
az vmss reimage |
Reimage VMs within a VMSS. |
az vmss restart |
Restart VMs within a VMSS. |
az vmss rolling-upgrade |
Manage rolling upgrades. |
az vmss rolling-upgrade cancel |
Cancels the current virtual machine scale set rolling upgrade. |
az vmss rolling-upgrade get-latest |
Gets the status of the latest virtual machine scale set rolling upgrade. |
az vmss rolling-upgrade start |
Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. |
az vmss run-command |
Manage run commands on a Virtual Machine Scale Set. |
az vmss run-command invoke |
Execute a specific run command on a Virtual Machine Scale Set instance. |
az vmss run-command list |
Lists all available run commands for a subscription in a location. |
az vmss run-command show |
Gets specific run command for a subscription in a location. |
az vmss scale |
Change the number of VMs within a VMSS. |
az vmss set-orchestration-service-state |
Change ServiceState property for a given service within a VMSS. |
az vmss show |
Get details on VMs within a VMSS. |
az vmss simulate-eviction |
Simulate the eviction of a Spot virtual machine in a VM scale set. |
az vmss start |
Start VMs within a VMSS. |
az vmss stop |
Power off (stop) VMs within a VMSS. |
az vmss update |
Update a VMSS. |
az vmss update-instances |
Upgrade VMs within a VMSS. |
az vmss wait |
Place the CLI in a waiting state until a condition of a scale set is met. |
az vmss create
Create an Azure Virtual Machine Scale Set.
For an end-to-end tutorial, see https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-linux-create-cli.
az vmss create --name
--resource-group
[--accelerated-networking {false, true}]
[--admin-password]
[--admin-username]
[--app-gateway]
[--app-gateway-capacity]
[--app-gateway-sku]
[--app-gateway-subnet-address-prefix]
[--asgs]
[--assign-identity]
[--authentication-type {all, password, ssh}]
[--automatic-repairs-grace-period]
[--backend-pool-name]
[--backend-port]
[--computer-name-prefix]
[--custom-data]
[--data-disk-caching]
[--data-disk-encryption-sets]
[--data-disk-iops]
[--data-disk-mbps]
[--data-disk-sizes-gb]
[--disable-overprovision]
[--dns-servers]
[--encryption-at-host {false, true}]
[--ephemeral-os-disk {false, true}]
[--eviction-policy {Deallocate, Delete}]
[--generate-ssh-keys]
[--health-probe]
[--host-group]
[--image]
[--instance-count]
[--lb]
[--lb-nat-pool-name]
[--lb-sku {Basic, Standard}]
[--license-type {None, RHEL_BYOS, SLES_BYOS, Windows_Client, Windows_Server}]
[--location]
[--max-price]
[--no-wait]
[--nsg]
[--orchestration-mode {ScaleSetVM, VM}]
[--os-disk-caching {None, ReadOnly, ReadWrite}]
[--os-disk-encryption-set]
[--os-disk-name]
[--os-disk-size-gb]
[--os-type {linux, windows}]
[--plan-name]
[--plan-product]
[--plan-promotion-code]
[--plan-publisher]
[--platform-fault-domain-count]
[--ppg]
[--priority {Low, Regular, Spot}]
[--public-ip-address]
[--public-ip-address-allocation {dynamic, static}]
[--public-ip-address-dns-name]
[--public-ip-per-vm]
[--role]
[--scale-in-policy {Default, NewestVM, OldestVM}]
[--scope]
[--secrets]
[--single-placement-group {false, true}]
[--specialized {false, true}]
[--ssh-dest-key-path]
[--ssh-key-values]
[--storage-container-name]
[--storage-sku]
[--subnet]
[--subnet-address-prefix]
[--subscription]
[--tags]
[--terminate-notification-time]
[--ultra-ssd-enabled {false, true}]
[--upgrade-policy-mode {Automatic, Manual, Rolling}]
[--use-unmanaged-disk]
[--validate]
[--vm-domain-name]
[--vm-sku]
[--vnet-address-prefix]
[--vnet-name]
[--zones {1, 2, 3}]
Examples
Create a Windows VM scale set with 5 instances, a load balancer, a public IP address, a 2GB data disk and 40GB OS disk.
az vmss create -n MyVmss -g MyResourceGroup --instance-count 5 --image Win2016Datacenter --data-disk-sizes-gb 2 --os-disk-size-gb 40
Create a Linux VM scale set with an auto-generated ssh key pair, a public IP address, a DNS entry, an existing load balancer, and an existing virtual network.
az vmss create -n MyVmss -g MyResourceGroup --public-ip-address-dns-name my-globally-dns-name \
--load-balancer MyLoadBalancer --vnet-name MyVnet --subnet MySubnet --image UbuntuLTS \
--generate-ssh-keys
Create a Linux VM scale set from a custom image using the default existing public SSH key.
az vmss create -n MyVmss -g MyResourceGroup --image MyImage
Create a Linux VM scale set with a load balancer and custom DNS servers. Each VM has a public-ip address and a custom domain name.
az vmss create -n MyVmss -g MyResourceGroup --image centos \
--public-ip-per-vm --vm-domain-name myvmss --dns-servers 10.0.0.6 10.0.0.5
Create a Linux VM scale set using a cloud-init script for configuration. See: https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init
az vmss create -g MyResourceGroup -n MyVmss --image debian --custom-data MyCloudInitScript.yml
Create a Linux VM scale set from a specialized image version.
az vmss create -n MyVmss -g MyResourceGroup --image $id --specialized
Create a Debian VM scaleset using Key Vault secrets.
az keyvault certificate create --vault-name vaultname -n cert1 \
-p "$(az keyvault certificate get-default-policy)"
secrets=$(az keyvault secret list-versions --vault-name vaultname \
-n cert1 --query "[?attributes.enabled].id" -o tsv)
vm_secrets=$(az vm secret format -s "$secrets")
az vmss create -g group-name -n vm-name --admin-username deploy \
--image debian --secrets "$vm_secrets"
Create a VM scaleset with system assigned identity. The VM will have a 'Contributor' Role with access to a storage account.
az vmss create -n MyVmss -g MyResourceGroup --image centos --assign-identity --scope /subscriptions/99999999-1bf0-4dda-aec3-cb9272f09590/MyResourceGroup/myRG/providers/Microsoft.Storage/storageAccounts/storage1
Create a debian VM scaleset with a user assigned identity.
az vmss create -n MyVmss -g rg1 --image debian --assign-identity /subscriptions/99999999-1bf0-4dda-aec3-cb9272f09590/resourcegroups/myRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myID
Create a debian VM scaleset with both system and user assigned identity.
az vmss create -n MyVmss -g rg1 --image debian --assign-identity [system] /subscriptions/99999999-1bf0-4dda-aec3-cb9272f09590/resourcegroups/myRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myID
Create a single zone VM scaleset in the current resource group's region
az vmss create -n MyVmss -g MyResourceGroup --image Centos --zones 1
Required Parameters
Name of the virtual machine scale set.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Enable accelerated networking. Unless specified, CLI will enable it based on machine image and size.
Password for the VM if authentication type is 'Password'.
Username for the VM. Default value is current username of OS. If the default value is system reserved, then default value will be set to azureuser. Please refer to https://docs.microsoft.com/en-us/rest/api/compute/virtualmachines/createorupdate#osprofile to get a full list of reserved values.
Name to use when creating a new application gateway (default) or referencing an existing one. Can also reference an existing application gateway by ID or specify "" for none.
The number of instances to use when creating a new application gateway.
SKU when creating a new application gateway.
The subnet IP address prefix to use when creating a new application gateway in CIDR format.
Space-separated list of existing application security groups to associate with the VM.
Accept system or user assigned identities separated by spaces. Use '[system]' to refer system assigned identity, or a resource id to refer user assigned identity. Check out help for more examples.
Type of authentication to use with the VM. Defaults to password for Windows and SSH public key for Linux. "all" enables both ssh and password authentication.
The amount of time (in minutes, between 30 and 90) for which automatic repairs are suspended due to a state change on VM.
Name to use for the backend pool when creating a new load balancer or application gateway.
When creating a new load balancer, backend port to open with NAT rules (Defaults to 22 on Linux and 3389 on Windows). When creating an application gateway, the backend port to use for the backend HTTP settings.
Computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to 15 characters long.
Custom init script file or text (cloud-init, cloud-config, etc..).
Storage caching type for data disk(s), including 'None', 'ReadOnly', 'ReadWrite', etc. Use a singular value to apply on all disks, or use <lun>=<vaule1> <lun>=<value2>
to configure individual disk.
Names or IDs (space delimited) of disk encryption sets for data disks.
Specify the Read-Write IOPS (space delimited) for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB.
Specify the bandwidth in MB per second (space delimited) for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB.
Space-separated empty managed data disk sizes in GB to create.
Overprovision option (see https://azure.microsoft.com/documentation/articles/virtual-machine-scale-sets-overview/ for details).
Space-separated IP addresses of DNS servers, e.g. 10.0.0.5 10.0.0.6.
Enable Host Encryption for the VM or VMSS. This will enable the encryption for all the disks including Resource/Temp disk at host itself.
Allows you to create an OS disk directly on the host node, providing local disk performance and faster VM/VMSS reimage time.
The eviction policy for virtual machines in a Spot priority scale set. Default eviction policy is Deallocate for a Spot priority scale set.
Generate SSH public and private key files if missing. The keys will be stored in the ~/.ssh directory.
Probe name from the existing load balancer, mainly used for rolling upgrade or automatic repairs.
Name or ID of dedicated host group that the virtual machine scale set resides in.
The name of the operating system image as a URN alias, URN, custom image name or ID, or VHD blob URI. Valid URN format: "Publisher:Offer:Sku:Version".
Number of VMs in the scale set.
Name to use when creating a new load balancer (default) or referencing an existing one. Can also reference an existing load balancer by ID or specify "" for none.
Name to use for the NAT pool when creating a new load balancer.
Sku of the Load Balancer to create. Default to 'Standard' when single placement group is turned off; otherwise, default to 'Basic'.
Specifies that the Windows image or disk was licensed on-premises. To enable Azure Hybrid Benefit for Windows Server, use 'Windows_Server'. To enable Multitenant Hosting Rights for Windows 10, use 'Windows_Client'. For more information see the Azure Windows VM online docs.
Location in which to create VM and related resources. If default location is not configured, will default to the resource group's location.
The maximum price (in US Dollars) you are willing to pay for a Spot VM/VMSS. -1 indicates that the Spot VM/VMSS should not be evicted for price reasons.
Do not wait for the long-running operation to finish.
Name or ID of an existing Network Security Group.
Choose how virtual machines are managed by the scale set. In VM mode, you manually create and add a virtual machine of any configuration to the scale set. In ScaleSetVM mode, you define a virtual machine model and Azure will generate identical instances based on that model.
Storage caching type for the VM OS disk. Default: ReadWrite.
Name or ID of disk encryption set for OS disk.
The name of the new VM OS disk.
OS disk size in GB to create.
Type of OS installed on a custom VHD. Do not use when specifying an URN or URN alias.
Plan name.
Plan product.
Plan promotion code.
Plan publisher.
Fault Domain count for each placement group in the availability zone.
The name or ID of the proximity placement group the VMSS should be associated with.
Priority. Use 'Spot' to run short-lived workloads in a cost-effective way. 'Low' enum will be deprecated in the future. Please use 'Spot' to deploy Azure spot VM and/or VMSS. Default to Regular.
Name of the public IP address when creating one (default) or referencing an existing one. Can also reference an existing public IP by ID or specify "" for None ('""' in Azure CLI using PowerShell or --% operator).
Globally unique DNS name for a newly created public IP.
Each VM instance will have a public ip. For security, you can use '--nsg' to apply appropriate rules.
Role name or id the system assigned identity will have.
Specify the scale-in policy (space delimited) that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in.
Scope that the system assigned identity can access.
One or many Key Vault secrets as JSON strings or files via @{path}
containing [{ "sourceVault": { "id": "value" }, "vaultCertificates": [{ "certificateUrl": "value", "certificateStore": "cert store name (only on windows)"}] }]
.
Limit the scale set to a single placement group. See https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-placement-groups for details.
Indicate whether the source image is specialized.
Destination file path on the VM for the SSH key. If the file already exists, the specified key(s) are appended to the file. Destination path for SSH public keys is currently limited to its default value "/home/username/.ssh/authorized_keys" due to a known issue in Linux provisioning agent.
Space-separated list of SSH public keys or public key file paths.
Only applicable when used with --use-unmanaged-disk
. Name of the storage container for the VM OS disk. Default: vhds.
The SKU of the storage account with which to persist VM. Use a singular sku that would be applied across all disks, or specify individual disks. Usage: [--storage-sku SKU | --storage-sku ID=SKU ID=SKU ID=SKU...], where each ID is "os" or a 0-indexed lun. Allowed values: Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS.
The name of the subnet when creating a new VNet or referencing an existing one. Can also reference an existing subnet by ID. If both vnet-name and subnet are omitted, an appropriate VNet and subnet will be selected automatically, or a new one will be created.
The subnet IP address prefix to use when creating a new VNet in CIDR format.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
Length of time (in minutes, between 5 and 15) a notification to be sent to the VM on the instance metadata server till the VM gets deleted.
Enables or disables the capability to have 1 or more managed data disks with UltraSSD_LRS storage account.
Do not use managed disk to persist VM.
Generate and validate the ARM template without creating any resources.
Domain name of VM instances, once configured, the FQDN is vm<vm-index>.<vm-domain-name>.<..rest..>
.
Size of VMs in the scale set. Default to "Standard_DS1_v2". See https://azure.microsoft.com/pricing/details/virtual-machines/ for size info.
The IP address prefix to use when creating a new VNet in CIDR format.
Name of the virtual network when creating a new one or referencing an existing one.
Space-separated list of availability zones into which to provision the resource.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss deallocate
Deallocate VMs within a VMSS.
az vmss deallocate --name
--resource-group
[--instance-ids]
[--no-wait]
[--subscription]
Examples
Deallocate VMs within a VMSS. (autogenerated)
az vmss deallocate --instance-ids 1 --name MyScaleSet --resource-group MyResourceGroup
Required Parameters
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Space-separated list of IDs (ex: 1 2 3 ...) or * for all instances. If not provided, the action will be applied on the scaleset itself.
Do not wait for the long-running operation to finish.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss delete
Deletes a VM scale set.
az vmss delete [--ids]
[--name]
[--no-wait]
[--resource-group]
[--subscription]
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Do not wait for the long-running operation to finish.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss delete-instances
Delete VMs within a VMSS.
az vmss delete-instances --instance-ids
--name
--resource-group
[--no-wait]
[--subscription]
Examples
Delete VMs within a VMSS. (autogenerated)
az vmss delete-instances --instance-ids 0 --name MyScaleSet --resource-group MyResourceGroup
Required Parameters
Space-separated list of IDs (ex: 1 2 3 ...) or * for all instances.
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Do not wait for the long-running operation to finish.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss get-instance-view
View an instance of a VMSS.
az vmss get-instance-view [--ids]
[--instance-id]
[--name]
[--resource-group]
[--subscription]
Examples
View an instance of a VMSS. (autogenerated)
az vmss get-instance-view --name MyScaleSet --resource-group MyResourceGroup
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
A VM instance ID or "*" to list instance view for all VMs in a scale set.
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss get-os-upgrade-history
Gets list of OS upgrades on a VM scale set instance.
az vmss get-os-upgrade-history [--ids]
[--name]
[--resource-group]
[--subscription]
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss list
List VMSS.
az vmss list [--query-examples]
[--resource-group]
[--subscription]
Examples
List VMSS (autogenerated)
az vmss list --resource-group MyResourceGroup
Optional Parameters
Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss list-instance-connection-info
Get the IP address and port number used to connect to individual VM instances within a set.
az vmss list-instance-connection-info [--ids]
[--name]
[--resource-group]
[--subscription]
Examples
Get the IP address and port number used to connect to individual VM instances within a set. (autogenerated)
az vmss list-instance-connection-info --name MyScaleSet --resource-group MyResourceGroup
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss list-instance-public-ips
List public IP addresses of VM instances within a set.
az vmss list-instance-public-ips [--ids]
[--name]
[--resource-group]
[--subscription]
Examples
List public IP addresses of VM instances within a set. (autogenerated)
az vmss list-instance-public-ips --name MyScaleSet --resource-group MyResourceGroup
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss list-instances
Gets a list of all virtual machines in a VM scale sets.
az vmss list-instances [--expand]
[--filter]
[--ids]
[--name]
[--resource-group]
[--select]
[--subscription]
Optional Parameters
The expand expression to apply to the operation. Allowed values are 'instanceView'.
The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss list-skus
Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU.
az vmss list-skus [--ids]
[--name]
[--resource-group]
[--subscription]
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss perform-maintenance
Perform maintenance on one or more virtual machines in a VM scale set.
Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications.
az vmss perform-maintenance [--ids]
[--instance-ids]
[--name]
[--resource-group]
[--subscription]
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Space-separated list of IDs (ex: 1 2 3 ...) or * for all instances. If not provided, the action will be applied on the scaleset itself.
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss reimage
Reimage VMs within a VMSS.
az vmss reimage [--ids]
[--instance-id]
[--name]
[--no-wait]
[--resource-group]
[--subscription]
Examples
Reimage VMs within a VMSS. (autogenerated)
az vmss reimage --instance-id 1 --name MyScaleSet --resource-group MyResourceGroup --subscription MySubscription
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
VM instance ID. If missing, reimage all instances.
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Do not wait for the long-running operation to finish.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss restart
Restart VMs within a VMSS.
az vmss restart --name
--resource-group
[--instance-ids]
[--no-wait]
[--subscription]
Examples
Restart VMs within a VMSS. (autogenerated)
az vmss restart --instance-ids 1 --name MyScaleSet --resource-group MyResourceGroup
Required Parameters
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Space-separated list of IDs (ex: 1 2 3 ...) or * for all instances. If not provided, the action will be applied on the scaleset itself.
Do not wait for the long-running operation to finish.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss scale
Change the number of VMs within a VMSS.
az vmss scale --new-capacity
[--ids]
[--name]
[--no-wait]
[--resource-group]
[--subscription]
Examples
Change the number of VMs within a VMSS. (autogenerated)
az vmss scale --name MyScaleSet --new-capacity 6 --resource-group MyResourceGroup
Required Parameters
Number of VMs in the VMSS.
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Do not wait for the long-running operation to finish.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss set-orchestration-service-state
Change ServiceState property for a given service within a VMSS.
az vmss set-orchestration-service-state --action {Resume, Suspend}
--service-name {AutomaticRepairs}
[--ids]
[--name]
[--no-wait]
[--resource-group]
[--subscription]
Examples
Change ServiceState property for AutomaticRepairs
az vmss set-orchestration-service-state --service-name AutomaticRepairs --action Resume --name MyScaleSet --resource-group MyResourceGroup
Required Parameters
The action to be performed.
The name of the orchestration service.
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Do not wait for the long-running operation to finish.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss show
Get details on VMs within a VMSS.
az vmss show --name
--resource-group
[--instance-id]
[--query-examples]
[--subscription]
Examples
Get details on VMs within a VMSS. (autogenerated)
az vmss show --name MyScaleSet --resource-group MyResourceGroup
Required Parameters
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
VM instance ID. If missing, show the VMSS.
Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss simulate-eviction
Simulate the eviction of a Spot virtual machine in a VM scale set.
az vmss simulate-eviction --instance-id
--name
--resource-group
[--subscription]
Examples
Simulate the eviction of a Spot virtual machine in a VM scale set.
az vmss simulate-eviction --resource-group MyResourceGroup --name MyScaleSet --instance-id 0
Required Parameters
The instance ID of the virtual machine.
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss start
Start VMs within a VMSS.
az vmss start --name
--resource-group
[--instance-ids]
[--no-wait]
[--subscription]
Examples
Start VMs within a VMSS. (autogenerated)
az vmss start --instance-ids 1 --name MyScaleSet --resource-group MyResourceGroup
Required Parameters
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Space-separated list of IDs (ex: 1 2 3 ...) or * for all instances. If not provided, the action will be applied on the scaleset itself.
Do not wait for the long-running operation to finish.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss stop
Power off (stop) VMs within a VMSS.
The VMs will continue to be billed. To avoid this, you can deallocate VM instances within a VMSS through "az vmss deallocate".
az vmss stop --name
--resource-group
[--instance-ids]
[--no-wait]
[--skip-shutdown]
[--subscription]
Examples
Power off VMs within a VMSS without shutting down.
az vmss stop --name MyScaleSet --resource-group MyResourceGroup --skip-shutdown
Power off (stop) VMs within a VMSS. (autogenerated)
az vmss stop --instance-ids 1 --name MyScaleSet --resource-group MyResourceGroup
Required Parameters
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Space-separated list of IDs (ex: 1 2 3 ...) or * for all instances. If not provided, the action will be applied on the scaleset itself.
Do not wait for the long-running operation to finish.
Skip shutdown and power-off immediately.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss update
Update a VMSS.
az vmss update [--add]
[--automatic-repairs-grace-period]
[--enable-automatic-repairs {false, true}]
[--enable-terminate-notification {false, true}]
[--force-string]
[--ids]
[--instance-id]
[--license-type {None, RHEL_BYOS, SLES_BYOS, Windows_Client, Windows_Server}]
[--max-price]
[--name]
[--no-wait]
[--ppg]
[--priority {Low, Regular, Spot}]
[--protect-from-scale-in {false, true}]
[--protect-from-scale-set-actions {false, true}]
[--remove]
[--resource-group]
[--scale-in-policy {Default, NewestVM, OldestVM}]
[--set]
[--subscription]
[--terminate-notification-time]
[--ultra-ssd-enabled {false, true}]
Examples
Update a VMSS' license type for Azure Hybrid Benefit.
az vmss update --name MyScaleSet --resource-group MyResourceGroup --license-type windows_server
Update a VM instance's protection policies.
az vmss update --name MyScaleSet --resource-group MyResourceGroup --instance-id 4 --protect-from-scale-set-actions False --protect-from-scale-in
Update a VM instance's protection policies.
az vmss update --name MyScaleSet --resource-group MyResourceGroup --instance-id 4 --set protectionPolicy.protectFromScaleIn=True protectionPolicy.protectFromScaleSetActions=False
Update a VM instance's Read-Write IOPS of the managed disk.
az vmss update --name MyScaleSet --resource-group MyResourceGroup --set virtualMachineProfile.storageProfile.dataDisks[0].diskIOPSReadWrite=444
Update a VM instance's bandwidth in MB per second of the managed disk.
az vmss update --name MyScaleSet --resource-group MyResourceGroup --set virtualMachineProfile.storageProfile.dataDisks[0].diskMBpsReadWrite=66
Optional Parameters
Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.
The amount of time (in minutes, between 30 and 90) for which automatic repairs are suspended due to a state change on VM.
Enable automatic repairs.
Enable terminate notification.
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Update the VM instance with this ID. If missing, Update the VMSS.
Specifies that the Windows image or disk was licensed on-premises. To enable Azure Hybrid Benefit for Windows Server, use 'Windows_Server'. To enable Multitenant Hosting Rights for Windows 10, use 'Windows_Client'. For more information see the Azure Windows VM online docs.
The maximum price (in US Dollars) you are willing to pay for a Spot VM/VMSS. -1 indicates that the Spot VM/VMSS should not be evicted for price reasons.
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Do not wait for the long-running operation to finish.
The name or ID of the proximity placement group the VMSS should be associated with.
Priority. Use 'Spot' to run short-lived workloads in a cost-effective way. 'Low' enum will be deprecated in the future. Please use 'Spot' to deploy Azure spot VM and/or VMSS. Default to Regular.
Protect the VM instance from scale-in operations.
Protect the VM instance from scale set actions (including scale-in).
Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Specify the scale-in policy (space delimited) that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in.
Update an object by specifying a property path and value to set. Example: --set property1.property2=.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Length of time (in minutes, between 5 and 15) a notification to be sent to the VM on the instance metadata server till the VM gets deleted.
Enables or disables the capability to have 1 or more managed data disks with UltraSSD_LRS storage account.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss update-instances
Upgrade VMs within a VMSS.
az vmss update-instances --instance-ids
--name
--resource-group
[--no-wait]
[--subscription]
Examples
Upgrade VMs within a VMSS. (autogenerated)
az vmss update-instances --instance-ids 1 --name MyScaleSet --resource-group MyResourceGroup
Required Parameters
Space-separated list of IDs (ex: 1 2 3 ...) or * for all instances.
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Do not wait for the long-running operation to finish.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
az vmss wait
Place the CLI in a waiting state until a condition of a scale set is met.
az vmss wait [--created]
[--custom]
[--deleted]
[--exists]
[--ids]
[--instance-id]
[--interval]
[--name]
[--resource-group]
[--subscription]
[--timeout]
[--updated]
Examples
Place the CLI in a waiting state until the VMSS has been updated.
az vmss wait --updated --name MyScaleSet --resource-group MyResourceGroup
Place the CLI in a waiting state until the VMSS instance has been updated.
az vmss wait --updated --instance-id 1 --name MyScaleSet --resource-group MyResourceGroup
Place the CLI in a waiting state until a condition of a scale set is met. (autogenerated)
az vmss wait --created --name MyScaleSet --resource-group MyResourceGroup
Optional Parameters
Wait until created with 'provisioningState' at 'Succeeded'.
Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].
Wait until deleted.
Wait until the resource exists.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Wait on the VM instance with this ID. If missing, Wait on the VMSS.
Polling interval in seconds.
Scale set name. You can configure the default using az configure --defaults vmss=<name>
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Maximum wait in seconds.
Wait until updated with provisioningState at 'Succeeded'.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.