0
votes

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

2

2 Answers

2
votes

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.

0
votes

Checkout the Remove-AzureStorageAccount CmdLet found here: http://msdn.microsoft.com/en-us/library/windowsazure/dn205189.aspx