Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
Where do I find the GUID for the storage account to pass into AssignToDataflowStorage? (ie. Bring Your Own Data Lake)
Context
I'm attempting to automate the creation of workspaces that use storage accounts for Dataflow storage. ie. Automate the creation of Power BI workspaces setup with Bring Your Own Data Lake. Below is how I am creating the storage account.
$storageAccount = New-AzStorageAccount -ResourceGroupName $AzureResourceGroup -Name $storageAccountName -AccessTier Hot -Location westus -SkuName Standard_RAGRS -EnableHierarchicalNamespace $true -Tag $tags -Kind StorageV2
$roleStorageAccount = New-AzRoleAssignment -SignInName $myUser.UserPrincipalName `
-RoleDefinitionName "Owner" `
-Scope $storageAccount.Id
This returns the resource which has a fully qualified resource ID that looks something like
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
I then try to make a call to AssignToDataflowStorage
$body = @{
dataflowStorageId = $storageAccount.Id
} | ConvertTo-Json
Invoke-PowerBIRestMethod -Url "/groups/$($PowerBIWorkspace.Id)/AssignToDataflowStorage" -Method Post -Body $body
The statement above does not work and I believe it does not work due to the fact that it's expecting a GUID and not a resource ID. The challenge is I do not know where to find the GUID for the storage account.
I tried running Get Dataflow Storage accounts
Invoke-PowerBIRestMethod -Url "dataflowStorageAccounts" -Method Get
And it lists off storage accounts with GUIDs that are already assigned to workspaces but I can't get the new storage account that I just created to show in this list.
{
"@odata.context":"http://wabi-west-us-redirect.analysis.windows.net/v1.0/myorg/$metadata#dataflowStorageAccounts","value":[
{
"id":"a9a9a9a9-a9a9-a9a9-a9a9-a9a9a9a9a9a9","name":"mystorageaccount1","isEnabled":true
},{
"id":"a9a9a9a9-a9a9-a9a9-a9a9-a9a9a9a9a9a9","name":"mystorageaccount2","isEnabled":true
}
]
}
I went to the UI and verified that the storage account does show there for manual assignment so I believe I have everything set up correctly. I tried adding "Power BI Service" with the "Reader and Data Access" role to the storage account and it still does not show in the list, but I'm only doing this to try to find the GUID. Does anyone know where I find the GUID to pass into AssignToDataflowStorage when doing this programmatically?
Thank you in advance for any possible help!
Hi @KevinSnow ,
Is this what you want?
How to find the GUID of your Azure AD tenant | Morgan Simonsen's Blog
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Unfortunately, that's not the value it's looking for. It's looking for the dataStorageId GUID. Essentially I'm trying to automate the step outlined here (and image below). I've automated the creation of the storage account so that the manual step below can be performed. The challenge I'm running into is it appears the manual step below first creates a dataflow storage account and then assigns that dataflow storage account to the workspace. The second part can be automated with the call to AssignToDataflowStorage but I'm unsure how to create a dataflow storage account from the Gen 2 data lake via API, if I could figure the later part out then a call to Get Dataflow Storage Accounts would give me the GUID and the whole process could be automated.