Describe the bug
When assigning Diagnostic Settings for Azure App Service via Azure CLI that has Storage Account for log Archiving enabled, the exception is thrown.
Text of the exception - (Conflict) Storage account '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx/resourcegroups/resource-group-name/microsoft.storage/storageaccounts/storageaccountname' is not accessible yet. Try again when storage provisioning is complete. While any other resource can be assigned with same Diagnostic Settings and storage account.
To Reproduce
Create App Service (our scenario is Linux Container)
Prepare Azure Storage account (or scenario is StorageV2 Standard_GRS Cool)
Execute code (variables configured appropriate to the environment):
az monitor diagnostic-settings create --name $appName --resource $appId --storage-account $strorageName --metrics '[{"category": "AllMetrics","enabled": true, "retentionPolicy": {"enabled": true, "days": 180 }}]'
Exception is thrown:
(Conflict) Storage account '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx/resourcegroups/resource-group-name/microsoft.storage/storageaccounts/storageaccountname' is not accessible yet. Try again when storage provisioning is complete
Replace App Service for different service (e.g. KeyVault), run the command and there is no exception
Assign App Service Diagnostic Settings via Portal with same Storage account - no exception
Expected behavior
Create App Service (our scenario is Linux Container)
Prepare Azure Storage account (or scenario is StorageV2 Standard_GRS Cool)
Describe the bug When assigning Diagnostic Settings for Azure App Service via Azure CLI that has Storage Account for log Archiving enabled, the exception is thrown. Text of the exception - (Conflict) Storage account '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx/resourcegroups/resource-group-name/microsoft.storage/storageaccounts/storageaccountname' is not accessible yet. Try again when storage provisioning is complete. While any other resource can be assigned with same Diagnostic Settings and storage account.
To Reproduce
az monitor diagnostic-settings create --name $appName --resource $appId --storage-account $strorageName --metrics '[{"category": "AllMetrics","enabled": true, "retentionPolicy": {"enabled": true, "days": 180 }}]'
(Conflict) Storage account '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx/resourcegroups/resource-group-name/microsoft.storage/storageaccounts/storageaccountname' is not accessible yet. Try again when storage provisioning is complete
Expected behavior
az monitor diagnostic-settings create --name $appName --resource $appId \ --storage-account $strorageName \ --metrics '[{"category": "AllMetrics","enabled": true, "retentionPolicy": {"enabled": true, "days": 180 }}]' \
Environment summary
az CLI verions - 2.27.1 OS - Windows 10 20H2 Shell - bash (git bash)
Additional context