Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force Azure Storage Account as classic

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

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: The storage account 'teststorage' was not found.

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. Force the storage account to be created as classic via Powershell?
  2. Instruct the New-AzureDeployment cmdlet to use the V2 storage account via Powershell?
like image 855
Focker Avatar asked Aug 07 '15 21:08

Focker


1 Answers

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

switch-azuremode -Name AzureServiceManagement
like image 175
Trondh Avatar answered Sep 19 '22 01:09

Trondh