0
votes

here is the ARM template to create storage account

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "storageAccountType": {
            "type": "string",
            "defaultValue": "Standard_LRS",
            "allowedValues": [
                "Standard_LRS",
                "Standard_ZRS",
                "Standard_GRS",
                "Standard_RAGRS",
                "Premium_LRS"
            ],
            "metadata": {
                "description": "Describes the storage type."
            }
        }
    },
    "resources": [
        ................
        {
            "apiVersion": "2015-06-15",
            "name": "[variables('storageName')]",
            "type": "Microsoft.Storage/storageAccounts",
            "location": "[resourceGroup().location]",
            "dependsOn": [ ],
            "tags": {
                "displayName": "storage"
            },
            "properties": {
                "accountType": "[parameters('storageAccountType')]"
            }
        }
    ]
}

works perfectly fine, however when I'm trying to use account type Standard_RAGRS to have geo replication it returns an error:

'The storage account named ..... already exists under the subscription.'

What am I doing wrong?

Thanks

2
Is it possible you already have a storage account with that name?Michael B
Yes I have however in release definition I use Action - Create or Update so as I understand it should update it.vshale
I'm not entirely sure I follow that, what is that set on?Michael B
In VSTS Release definition there is a task "Azure Resource Group Deployment" - it has a property "Action" with possible value - Create or Update Resource Group. Other values are Select/Delete Resource Group. I assume it should update storage to turn geo replication on but looks like that's not the case.vshale
It could also be possible the name you are using might already be used.TusharJ

2 Answers

0
votes

There is no issue in your ARM template on the Storage Account resource.

I am able to use this template to provision storage accounts with different account types successfully.

The root cause based on your error message is because you already have an existing storage account name under the same resource group and same subscription with the one you're trying to create.

I am able to reproduce your error exactly with the same scenario above.

message":"The storage account named 'abcstorageacct' already exists under the subscription."}}

0
votes

You can update resource properties in a subsequent deployment for some properties but this varies by resource and property. Unfortunately, I don't know of a good list of what's allowed.

Seems like that error could be improved...