Search code examples
azureazure-devopsazure-bicep

Azure - Using bicep to set storage container access policy


Can Bicep be used to do what this Azure CLI script does?

az storage container policy create \
    --container-name $containerName \
    --name $policyName \
    --account-name $storageAccountName \
    --account-key $accountKey \
    --permissions $permissions \
    --start $policyStartTime \
    --expiry $policyEndTime

Solution

  • No.

    It's not possible in ARM (see Azure Blob Storage Container Stored Access Policy with ARM). Bicep is just a compiler that translates bicep code into ARM code that is used then to do the deployment.