ARM Template Error: The condition specified using HTTP conditional header(s) is not met

Andrew G 1 Reputation point
2022-04-20T23:32:23.253+00:00

I am deploying an ARM template in which I enable the container soft delete feature.

The deployment fails intermittently with the following error:
{
"status": "Failed",
"error": {
"code": "ContainerOperationFailure",
"message": "The condition specified using HTTP conditional header(s) is not met.\nRequestId:7a49aa49-a01e-005d-620d-55e0a0000000\nTime:2022-04-20T23:20:58.4892716Z"
}
}

I have tried multiple apiVersions for the Microsoft.Storage/storageAccounts/blobServices resource, but the issue persists.

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,330 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. shiva patpi 13,256 Reputation points Microsoft Employee
    2022-04-21T05:33:07.49+00:00

    Hello @AndrewGailer-5079 ,
    I just tried with below template and it got created successfully!

    {
    "$schema":"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion":"1.0.0.0",
    "parameters":{
    "location":{
    "type":"string"
    },
    "storageAccountName":{
    "type":"string"
    }
    },
    "variables":{

    },
    "resources":[
    {
    "type":"Microsoft.Storage/storageAccounts",
    "sku":{
    "name":"Standard_LRS",
    "tier":"Standard"
    },
    "kind":"StorageV2",
    "name":"[parameters('storageAccountName')]",
    "apiVersion":"2018-07-01",
    "location":"[parameters('location')]"
    },
    {
    "name":"[concat(parameters('storageAccountName'), '/default')]",
    "type":"Microsoft.Storage/storageAccounts/blobServices",
    "apiVersion":"2021-09-01",
    "properties":{
    "deleteRetentionPolicy":{
    "enabled":true,
    "days":30
    },
    "containerDeleteRetentionPolicy":{
    "enabled":true,
    "days":30
    }
    },
    "dependsOn":[
    "[concat('Microsoft.Storage/storageAccounts/', parameters('storageAccountName'))]"
    ]
    }
    ],
    "outputs":{
    }
    }

    az group create -n sawithsd -l eastus
    az group deployment create -n sawithsd -g sawithsd --template-file C:\azure\storageaccountwithsoftdelete.json --parameters storageAccountName=sawithsd2 location=eastus


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.