The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi guys!
I am exporting datasets via Powershell and looping over almost all of our workspaces.
And I am getting "Operation returned an invalid status code 'TooManyRequests'"
How can I solve this in my script so I do not get this error?
What is the limit of requests?
Here is some code from my script where I start looping datasets per workspace.
$result_DataSets =
ForEach ($rec_ws in $result_Workspaces| ? { $_.IsOnDedicatedCapacity -eq 1 -and $_.State -eq "Active" -and $_.Name -Like "N-SWE-*"})
{
$i_ws++
Write-Host "$i_ws - WS: $($rec_ws.name) - (Id:$($rec_ws.id))"
ForEach ($rec_dataset in (Get-PowerBIDataset -scope $filter_scope -WorkspaceId $rec_ws.id | where-object {$_.name -notin "Usage Metrics Report","Report Usage Metrics Model"}))
{
[pscustomobject]@{
WorkspaceName = $rec_ws.Name
WorkspaceID = $rec_dataset.Id
DatasetID = $rec_dataset.Id
DatasetName = $rec_dataset.Name
ConfiguredBy = $rec_dataset.ConfiguredBy
IsRefreshable = $rec_dataset.IsRefreshable
IsEffectiveIdentityRequired = $rec_dataset.IsEffectiveIdentityRequired
IsEffectiveIdentityRolesRequired = $rec_dataset.IsEffectiveIdentityRolesRequired
IsOnPremGatewayRequired = $rec_dataset.IsOnPremGatewayRequired
TargetStorageMode = $rec_dataset.TargetStorageMode
#ActualStorage = $rec_dataset.ActualStorage
CreatedDate = $rec_dataset.CreatedDate
#ContentProviderType = $dataset.ContentProviderType
"Date Retrieved" = $RetrieveDate
}
}
I have noticed that I can call it 200 times until the error shows up.