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?
-
If you know the resource group name and the availability set name, you can use the following PowerShell command `Remove-AzureRmAvailabilitySet -Name "
" -ResourceGroupName " – Jack Zeng Mar 28 '16 at 00:49"` -
@JackZeng Any reason you posted as a comment vs an answer? – David Makogon Mar 28 '16 at 04:49
-
I was just giving a shot answer and hoping the OP would figure it by herself. If not, I would give an answer according to her feedback. Well, a good answer would include how to install Azure PowerShell, how to login, how to get information about the availability set, and finally how to delete it. Since @MichaelB has already given a good answer, no need for me to add anything now. – Jack Zeng Mar 28 '16 at 06:22
1 Answers
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.
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
-
Thanks. Turns out Azure automatically deletes empty availability sets because when I went back into the Portal to remove it it was already gone. – Alex Egli Mar 29 '16 at 00:05