Thursday, July 24, 2014

Azure - Deleting VNet

Trying to delete a Virtual Network in Azure

Powershell command:
Note this removes all Virtual Networks from your active Azure Subscription

But then:
Remove-AzureVNetConfig : BadRequest : Cannot delete or modify virtual network while in use 'xxxxx'.

I do not have Virtual Machines as I removed them all. But then I noticed the VNetwork has a Gateway assigned to it.

So remove the gateway before removing the VNetwork.

Delete the Gateway

By the way, the Powershell command for deleting a VNet Gateway:
Remove-AzureVNetGateway -VNetName "SPAutoVNet"

No comments:

Post a Comment