简体   繁体   English

如何从Azure订阅中删除当前存储帐户?

[英]How to remove current storage account from Azure Subscription?

I am learning how to set up AZURE from powershell. 我正在学习如何从powershell设置AZURE。 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 (Get-AzureSubscription).CurrentStorageAccount仍显示相同的名称,尽管我已从Azure门户中删除了该名称

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 我使用Set-AzureSubscription -CurrentStorageAccount“ Name”进行设置

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.. 要删除,我检查了Remove-AzureSubscription,但是它没有该选项,什么是删除Azure订阅,因为我阅读了Microsoft文章,但由于我是新手,所以无法理解。

will this command delete my Azure subscription? 该命令会删除我的Azure订阅吗? 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). 尽管Set-AzureSubscription文档说您可以(使用-ResetCurrentStorageAccount参数)重置当前存储帐户,但我认为它尚未实现(至少我无法使其正常工作)。

When you call Set-AzureSubscription cmdlet, it basically creates an XML file by the name DefaultSubscriptionData.xml . 调用Set-AzureSubscription cmdlet时,它基本上会创建一个名称为DefaultSubscriptionData.xml的XML文件。 This file is stored in C:\\Users\\<Your Local Username>\\AppData\\Roaming\\Windows Azure Powershell folder. 此文件存储在C:\\Users\\<Your Local Username>\\AppData\\Roaming\\Windows Azure Powershell文件夹中。 What you could do is edit the file and change the value of CurrentStorageAccount node. 您可以做的是编辑文件并更改CurrentStorageAccount节点的值。 You would need to reopen PowerShell console for these changes to take effect. 您需要重新打开PowerShell控制台才能使这些更改生效。

Please note that Set-AzureSubscription cmdlet does not impact your server side settings. 请注意, Set-AzureSubscription cmdlet不会影响您的服务器端设置。 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. 从本质上讲,此cmdlet是设置订阅范围设置的便捷方法,这样您在执行cmdlet时不必一遍又一遍地指定它们。 This is what the documentation also states: 这是文档还指出的内容:

The Set-AzureSubscription cmdlet configures common settings including subscription ID, management certificate, and custom endpoints. Set-AzureSubscription cmdlet配置常见设置,包括订阅ID,管理证书和自定义终结点。 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. 若要选择一个订阅并使其成为当前订阅,请使用Select-AzureSubscription cmdlet。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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