Set-AzDiagnosticSetting gives a storage not provisioned error

Panzerbjrn 1 Reputation point
2020-06-15T16:45:38.127+00:00

Hi all, I'm trying to set up some diagnostic logging via this PowerShell command, but it isn't working.

The command I'm running is:
Set-AzDiagnosticSetting -ResourceId "/subscriptions/xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/LPTestRG/providers/Microsoft.PowerBIDedicated/capacities/pbiewi38848" -StorageAccountId "/subscriptions/xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/LPTestRG/providers/Microsoft.Storage/storageAccounts/lptestsa"

I then get the error:
Set-AzDiagnosticSetting : Exception type: ErrorResponseException, Message: Storage account
'/subscriptions/xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourcegroups/lptestrg/providers/microsoft.storage/storageaccounts/lptestsa' is not accessible yet. Try again when storage provisioning is complete.,
Code: Conflict, Status code:Conflict, Reason phrase: Conflict

Running Get-AzStorageAccount, I can see that provisioning has succeeded, and I have a bunch of blobs and tables in there anyway, so I know that it works.
I am running the latest AZ module, and have checked Az.Monitor and Az.Storage against the PS Gallery to be sure.

Any ideas anyone?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,936 questions
{count} votes

1 answer

Sort by: Most helpful
  1. bharathn-msft 5,086 Reputation points Microsoft Employee
    2020-07-08T18:18:00.61+00:00

    @Panzerbjrn Premium_LRS storage resource is not supported for this integration and also additionally storage resource which has isHnsEnabled is also not supported. So please make sure to see if the storage account you are looking to enable is visible in the Portal UI with in PowerBI Embedded Diagnostic setting blade.

    11627-diagnostic-setting.jpg

    Once you have confirmation of the storage account , please run through the below command and it should enable diagnostic setting.

      Set-AzDiagnosticSetting -ResourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myrgwithpowerbi/providers/Microsoft.PowerBIDedicated/capacities/powerbiembeddedname" -StorageAccountId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myrgwithstroageaccount/providers/Microsoft.Storage/storageAccounts/stroageaccountname" -Enabled $true
    

    Hope this information helps, please revert back if you have any further queries. Happy to continue the conversation. Thank you