如何强制将Azure存储帐户设置为经典 [英] How to force Azure Storage Account as classic

查看:82
本文介绍了如何强制将Azure存储帐户设置为经典的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们最近使用Azure资源管理器和模板构建了基础结构和应用程序部署框架.为了部署云服务,需要首先设置一个Azure存储帐户.从最近开始,这是通过运行以下命令来完成的:

We recently built a infrastructure and application deployment framework using the Azure Resource Manager and templates. In order to deploy a Cloud Service, it is required to first setup an Azure Storage Account. As of recently, this was accomplished by running:

Switch-AzureMode AzureResourceManager

New-AzureStorageAccount -ResourceGroupName $resourceGroupName -StorageAccountName $storageAccountName -Location $locationName -Type Standard_LRS

这将创建一个存储帐户,New-AzureDeployment cmdlet可以将其用于部署.据我所记得,创建的存储帐户将是现在在UI中标记为经典"的存储帐户.但是,随着最近的更改,现在使用上述脚本创建的存储帐户是非经典(V2). New-AzureDeployment无法识别此V2存储帐户,并将该帐户存储在Powershell脚本中:

This would create a storage account that the New-AzureDeployment cmdlet could use for the deployment. As far as I can remember, the storage account created would be one that the now labeled as "classic" in the UI. However, with recent changes, the storage account that is now created using the script above is non-classic (V2). This V2 storage account is not recognized by the New-AzureDeployment, and it throws this in the Powershell script:

New-AzureDeployment:ResourceNotFound:找不到存储帐户"teststorage".

如果我在UI中手动创建经典存储帐户,则可以将其用于部署,并且效果很好.

If I manually create the classic storage account in the UI, I can use it for my deployment, and it works just fine.

因此可以执行以下操作之一:

So is it possible to do one of the following:

  1. 通过Powershell强制将存储帐户创建为经典帐户吗?
  2. 指示New-AzureDeployment cmdlet通过Powershell使用V2存储帐户吗?

推荐答案

切换回asm模式(v1 API)并从那里创建存储帐户:

Switch back to asm mode (the v1 api) and create the storage account from there:

switch-azuremode -Name AzureServiceManagement

这篇关于如何强制将Azure存储帐户设置为经典的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆