Azure CLI - delete subscription?

孤街浪徒 提交于 2020-01-25 07:49:05

问题


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


回答1:


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.




回答2:


New feature in REST API already as preview:

The operation to cancel a subscription

https://docs.microsoft.com/en-us/rest/api/resources/subscriptions%20(preview)/cancel



来源:https://stackoverflow.com/questions/58081649/azure-cli-delete-subscription

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!