Syntax Highlighter

miércoles, 6 de julio de 2016

The storage account already exists error when redeploying an ARM template

Update 06 Jul 2016

Seems this is resolved on the latest Storage Resource Provider API 2016-01-01. The schema documented at https://azure.microsoft.com/en-us/documentation/articles/resource-manager-template-storage/ is for 2015-06-15, and that version didn’t support PUT operations. The new 2016-01-01 schema can be found at:

So this new template now works as expected and tags and other settings can be changed:

{

    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",

    "contentVersion": "1.0.0.0",

    "resources": [

      {

        "name": "dnntest20160705",

        "type": "Microsoft.Storage/storageAccounts",

        "location": "[resourceGroup().location]",

        "apiVersion": "2016-01-01",

        "dependsOn": [ ],

        "tags": {

          "displayName": "MyStorageAccount"

        },

        "sku": {

          "name": "Standard_LRS"

        },

        "kind": "Storage"

      }

    ]

}

 

Notes:

  • Ensure you install the latest Azure PowerShell and SDKs or the latest 2016-01-01 version won’t be recognized
  • With the latest Azure SDK 2.9.1 available, I have syntax errors on the template, seems the schema was not included in the latest release. While you have syntax errors, you can deploy from Visual Studio with no problems. I suppose this will be fixed on the next Azure SDK release.

Thanks to Tom FitzMacken for the indications.

_____________________________________________________________________________

Original issue description

Seems that when deploying an storage account using an ARM template like the one below:

{

    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",

    "contentVersion": "1.0.0.0",

    "resources": [

      {

        "name": "dnntest20160705",

        "type": "Microsoft.Storage/storageAccounts",

        "location": "[resourceGroup().location]",

        "apiVersion": "2015-06-15",

        "dependsOn": [ ],

        "tags": {

          "displayName": "MyStorageAccount"

        },

        "properties": {

          "accountType": "Standard_LRS"

        }

      }

    ]

}

 

If you go and change the “displayName” tag value for something else or try to add a new tag, when you deploy the update I get the following deployment exception:

22:44:07 - [ERROR] New-AzureRmResourceGroupDeployment : 22:44:07 - Resource

22:44:07 - [ERROR] Microsoft.Storage/storageAccounts 'dnntest20160705' failed with message '{

22:44:07 - [ERROR]   "error": {

22:44:07 - [ERROR]     "code": "StorageAccountAlreadyExists",

22:44:07 - [ERROR]     "message": "The storage account named dnntest20160705 already exists under

22:44:07 - [ERROR] the subscription."

22:44:07 - [ERROR]   }

22:44:07 - [ERROR] }'

22:44:07 - [ERROR] At D:\temp\azureresourcegroup2\Scripts\Deploy-AzureResourceGroup.ps1:98 char:1

Workaround

Change the tag value through the portal/PowerShell, so new deployment updates work.

 

This sounds like a bug, that will probably be resolved in a future release.

martes, 5 de julio de 2016

The storage account already exists error when redeploying an ARM template

Seems that when deploying an storage account using an ARM template like the one below:

{

    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",

    "contentVersion": "1.0.0.0",

    "resources": [

      {

        "name": "dnntest20160705",

        "type": "Microsoft.Storage/storageAccounts",

        "location": "[resourceGroup().location]",

        "apiVersion": "2015-06-15",

        "dependsOn": [ ],

        "tags": {

          "displayName": "MyStorageAccount"

        },

        "properties": {

          "accountType": "Standard_LRS"

        }

      }

    ]

}

 

If you go and change the “displayName” tag value for something else or try to add a new tag, when you deploy the update I get the following deployment exception:

22:44:07 - [ERROR] New-AzureRmResourceGroupDeployment : 22:44:07 - Resource

22:44:07 - [ERROR] Microsoft.Storage/storageAccounts 'dnntest20160705' failed with message '{

22:44:07 - [ERROR]   "error": {

22:44:07 - [ERROR]     "code": "StorageAccountAlreadyExists",

22:44:07 - [ERROR]     "message": "The storage account named dnntest20160705 already exists under

22:44:07 - [ERROR] the subscription."

22:44:07 - [ERROR]   }

22:44:07 - [ERROR] }'

22:44:07 - [ERROR] At D:\temp\azureresourcegroup2\Scripts\Deploy-AzureResourceGroup.ps1:98 char:1

Workaround

Change the tag value through the portal/PowerShell, so new deployment updates work.

 

This sounds like a bug, that will probably be resolved in a future release.

Related Posts Plugin for WordPress, Blogger...