Redeploy Linux virtual machine to new Azure node

If you face difficulties troubleshooting SSH or application access to a Linux virtual machine (VM) in Azure, redeploying the VM may help. When you redeploy a VM, it moves the VM to a new node within the Azure infrastructure and then powers it back on. All your configuration options and associated resources are retained. This article shows you how to redeploy a VM using Azure CLI or the Azure portal.

Note

After you redeploy a VM, the temporary disk is lost and dynamic IP addresses associated with virtual network interface are updated.

Use the Azure CLI

Install the latest Azure CLI and log in to your Azure account using az login.

Redeploy your VM with az vm redeploy. The following example redeploys the VM named myVM in the resource group named myResourceGroup:

az vm redeploy --resource-group myResourceGroup --name myVM 

Use the Azure classic CLI

Install the latest Azure classic CLI and log in to your Azure account. Make sure that you are in Resource Manager mode (azure config mode arm).

The following example redeploys the VM named myVM in the resource group named myResourceGroup:

azure vm redeploy --resource-group myResourceGroup --vm-name myVM 

Use the Azure portal

  1. Select the VM you wish to redeploy, then select the Redeploy button in the Settings blade. You may need to scroll down to see the Support and Troubleshooting section that contains the 'Redeploy' button as in the following example:

    Azure VM blade

  2. To confirm the operation, select the Redeploy button:

    Redeploy a VM blade

  3. The Status of the VM changes to Updating as the VM prepares to redeploy, as shown in the following example:

    VM updating

  4. The Status then changes to Starting as the VM boots up on a new Azure host, as shown in the following example:

    VM starting

  5. After the VM finishes the boot process, the Status then returns to Running, indicating the VM has been successfully redeployed:

    VM running

Next steps

If you are having issues connecting to your VM, you can find specific help on troubleshooting SSH connections or detailed SSH troubleshooting steps. If you cannot access an application running on your VM, you can also read application troubleshooting issues.