Rob Ert
Rob Ert

Reputation: 482

Azure CLI - delete subscription?

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

Answers (3)

Mevlüt K.
Mevlüt K.

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

Rob Ert
Rob Ert

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

4c74356b41
4c74356b41

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

Related Questions