Reputation: 482
I am looking for a way to delete Azure subscription programmatically. I'm mainly interested in Azure CLI but i can not find the way to do that in proper way.
By the way there is PowerShell Command which provide exactly needed action. Remove-AzureSubscription
Upvotes: 0
Views: 5065
Reputation: 1
Warning from Azure portal after cancelling my subcription : You will be able to manually delete this subscription 3 days after it was initally cancelled
Upvotes: 0
Reputation: 482
New feature in REST API already as preview:
The operation to cancel a subscription
https://learn.microsoft.com/en-us/rest/api/resources/subscriptions%20(preview)/cancel
Upvotes: 0
Reputation: 72171
there is no way to delete a subscription. the linked cmdlet doesn't do what you think it does:
The Remove-AzureSubscription cmdlet deletes an Azure subscription from your subscription data file so Windows PowerShell can't find it. This cmdlet does not delete the subscription from Microsoft Azure, or change the actual subscription in any way.
only Azure Support might be able to help you, although in my case they said its impossible to delete subscriptions.
Upvotes: 4