Syntax Highlighter

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.

No hay comentarios:

Publicar un comentario

Related Posts Plugin for WordPress, Blogger...