azureazure-virtual-machineazure-availability-set

How do I delete an availability set?


I wanted to try out using Azure availability sets, but it turns out I can't use them because my nodes cannot be in the same cloud service. I now have an unused availability set but I don't see it listed anywhere in my Resources in the Portal. Is there anyway to delete an availability set?


Solution

  • If you are using the old portal (manage.windowsazure.com) it isn't possible to delete an availability set. This is because availability sets are a Resource management features, and those features are invisible to the old portal.

    In the new portal (portal.azure.com) You need to go through Browse (at the bottom of the left column) > Availability set > Select the one you want, and delete on the next blade. Or you can click on the three dots, and there is a small menu selection there with delete in it.

    Portal availability set deletion

    Other than that, there is the option supplied by @Jack Zeng above. By using Powershell. In this case, I used -

    Add-AzureRmAccount
    Get-AzureRmResourceGroup                                                                                                                                                                 
    get-AzureRmAvailabilitySet -ResourceGroupName avtest                                                                                                                                     
    Remove-AzureRmAvailabilitySet -ResourceGroupName avtest -Name avtest 
    

    Once you have the Azure Powershell tools installed (get them from here) The first line will log you into your Azure account.

    The second line of this will find you a list of all Resource Groups, if you look through that you can find the resource group name for the availability set you wish to delete.

    The third line gets all of the availability sets in that Resource Group.

    The fourth line deletes it. It will ask you to confirm the deletion, if you are positive that you do you can click / type yes. Alternatively you can use the -force option for Remove-AzureRmAvailabilitySet