使用Powershell清除/更改存储帐户的CustomDomainName

时间:2016-02-11 08:07:42

标签: azure-storage azure-powershell

我想为azure存储帐户设置自定义域名(v2?,而非经典帐户)。

With this answer I managed to use powershell为一个域和一个存储帐户设置它。 对于另一个域和另一个存储帐户,我认为我已正确配置它,但是当我尝试配置它时,我收到此错误:

Set-AzureRmStorageAccount -ResourceGroupName "ExampleGroup" -Name "test" -CustomDomainName test.example.com -UseSubDomain $true

Set-AzureRmStorageAccount : CustomDomainNameAlreadySet: Custom domain name is already set.  Current value must be cleared before setting a new value.
+ Set-AzureRmStorageAccount -ResourceGroupName "ExampleGroup" -Name " ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Set-AzureRmStorageAccount], CloudException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Management.Storage.SetAzureStorageAccountCommand

我发现的唯一answer意味着应该使用不是选项的经典门户网站,因为v2存储帐户不会显示在那里。

如何清除CustomDomainName值?

1 个答案:

答案 0 :(得分:1)

目前,如果您设置了自定义域名并想要替换它,则必须先取消注册。要取消注册,请将CustomDomainName设置为空字符串,并且不要发送UseSubDomain。