Retiring an old Virtual Machine

RMA 20 Reputation points
2025-12-05T21:01:11.9933333+00:00

Hi I have recently created a new virtual machine and I want to completely delete and retire the old VM so that it does not continue to incur costs. How do I go about do that?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-05T21:01:25.0133333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To completely delete and retire an old virtual machine (VM) in Azure, follow these steps:

    1. Sign in to the Azure portal: Go to the Azure portal.
    2. Navigate to Virtual Machines: In the left-hand menu, select Virtual Machines to view your list of VMs.
    3. Select the VM to delete: Find and click on the VM you want to delete.
    4. Delete the VM: In the VM's menu, select Delete. You will be prompted to confirm the deletion.
    5. Confirm deletion: Click Yes to confirm that you want to delete the VM.

    Note that when you delete a VM, it may not automatically delete associated resources like networking and disk resources unless specified. Make sure to check the settings if you want to delete those as well.

    If you want to avoid incurring costs from any associated resources, ensure that you also delete or manage those resources accordingly.


    References:


  2. Manish Deshpande 1,170 Reputation points Microsoft External Staff Moderator
    2025-12-05T21:20:16.83+00:00

    Hello @RMA

    It appears you intend to delete your previous Azure Virtual Machine to avoid ongoing charges now that a new one has been set up. Below are the recommended steps to securely delete and decommission your old VM

    When you go to delete an existing VM, you'll find an option to apply force delete in the delete pane.

    1. Backup Important Data: Before you delete the VM, make sure to back up any important data or configurations. You can use Azure Backup to create a final backup.
    2. Stop the VM: Before deleting, you'll need to stop the VM. You can do this from the Azure portal or using PowerShell/Azure CLI:
      • Azure Portal: Go to your VM, click on "Stop".
      • PowerShell:
             Stop-AzVM -ResourceGroupName "YourResourceGroup" -Name "YourVMName" -Force
        
      • Azure CLI:
             az vm stop --resource-group YourResourceGroup --name YourVMName
        
    3. Delete the VM: Once the VM is stopped, you can proceed to delete it:
      • Azure Portal: Navigate to your VM, select "Delete".
      • PowerShell:
             Remove-AzVM -ResourceGroupName "YourResourceGroup" -Name "YourVMName"
        
      • Azure CLI:
             az vm delete --resource-group YourResourceGroup --name YourVMName --yes
        
    4. Delete Other Resources: If your VM had associated resources like disks or public IP addresses that you no longer need, consider deleting those as well to avoid additional costs.
    5. In the Delete virtual machine pane, select the checkbox for Apply force delete.
    • If you had any backups configured, make sure to stop those backups before deleting the VM to avoid any ongoing costs tied to backup retention.
    • If your VM was part of a scale set or had any integrations, ensure that there are no dependencies left that could affect other resources.

    I hope this helps you manage your Azure resources effectively! If you have any follow-up questions or need further assistance, feel free to ask.

    Reference Link

    https://learn.microsoft.com/en-us/azure/virtual-machines/delete?tabs=portal2%2Ccli3%2Cportal4%2Cportal5

    Thanks,
    Manish Deshpande.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.