简体   繁体   中英

How to remove current storage account from Azure Subscription?

I am learning how to set up AZURE from powershell. So I created a storage account and set it as current storage account and I deleted it from azure but

(Get-AzureSubscription).CurrentStorageAccount still shows the same name though I deleted it from my azure portal

so How to do i remove this from my subscription?

what is the significance of adding it to subscription?

I used Set-AzureSubscription -CurrentStorageAccount "Name" to set up

to Remove I checked Remove-AzureSubscription But it does not have that option and what is remove azure subscription is for I read the microsoft article but not to able to understand since i am brand new to it..

will this command delete my Azure subscription? if I have all my network and VMs will all get deleted?

Thanks

Even though the documentation for Set-AzureSubscription says that you can reset current storage account (using -ResetCurrentStorageAccount parameter), I don't think it is implemented yet (at least I could not make it working).

When you call Set-AzureSubscription cmdlet, it basically creates an XML file by the name DefaultSubscriptionData.xml . This file is stored in C:\\Users\\<Your Local Username>\\AppData\\Roaming\\Windows Azure Powershell folder. What you could do is edit the file and change the value of CurrentStorageAccount node. You would need to reopen PowerShell console for these changes to take effect.

Please note that Set-AzureSubscription cmdlet does not impact your server side settings. This cmdlet is basically a convenient way for you to set subscription wide settings so that you don't have to specify them over and over again when you're executing the cmdlet. This is what the documentation also states:

The Set-AzureSubscription cmdlet configures common settings including subscription ID, management certificate, and custom endpoints. The settings are stored in a subscription data file in the user's profile or in a user specified file. Multiple subscription data sets are supported and identified by a subscription name. To select a subscription and make it current, use the Select-AzureSubscription cmdlet.

签出在此处找到的Remove-AzureStorageAccount CmdLet: http : //msdn.microsoft.com/en-us/library/windowsazure/dn205189.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM