Forum Discussion
Anonymous
5 years agoNot applicable
API Limitations using Get commands "TooManyRequests" Error
I've been unable to find documentation on the limits of GET requests from the Power BI REST API. On the website they have details for POST listed, but not GET. See: https://docs.microsoft.com/en-us/...
Anonymous
4 years agoNot applicable
Hello! Unfortunately I don't recall having a good solution for this issue. However, it appears I've made some changes to the script since I first asked for help. I believe I tinkered with the start-sleep time both inside and outside of the foreach loop and that seemed to have helped.
#################################
# Reports #
#################################
# Loops through each workspace and lists the reports in the workspace.
$ReportsStopWatch = New-Object -TypeName System.Diagnostics.Stopwatch
$ReportsStopWatch.Start()
$ReportListExportPath = $exportPath + "ReportList" + $exportPathFileType
Write-Host ""
Write-Host "Starting Reports extract..." -ForegroundColor green
$ReportsIncrementalCounter = 0
Start-Sleep -Seconds 300
$ReportList =
ForEach ($workspace in $Workspaces)
{
$ReportsIncrementalCounter ++
Write-Host $ReportsIncrementalCounter " of " $Workspaces.Count " total workspaces. Fetching reports in workspace: " $workspace.Name
#The script has to be paused to work around the API rate limitations error "too many requests".
Start-Sleep -Seconds 10
ForEach ($report in (Get-PowerBIReport -Scope Organization -WorkspaceId $workspace.Id))
{
[pscustomobject]@{
WorkspaceID = $workspace.Id
WorkspaceName = $workspace.Name
ReportID = $report.Id
ReportName = $report.Name
ReportURL = $report.WebUrl
ReportDatasetID = $report.DatasetId
}
}
}
$ReportList
if ($?) {
Write-Host "Successfully retrieved report variables." -ForegroundColor green
Write-Host "Exporting report information to .csv file." -ForegroundColor green
$ReportList | Export-CSV $ReportListExportPath -NoTypeInformation -Encoding UTF8
if ($?) {
Write-Host "Successfully saved PowerBIReportList_$currentDate to C:\users\$env:USERNAME\Desktop" -ForegroundColor green
}
else {
write-host "Failed to save PowerBIReportList file to C:\users\$env:USERNAME\Desktop" -ForegroundColor yellow
}
}
else {
Write-Host "Failed to login to PowerBI. NOTE: Must have Global Admin, within Office 365 or Azure AD, or be a Power BI service administrator." -ForegroundColor yellow
break
}
$ReportsElapsedTime = $ReportsStopWatch.Elapsed.Ticks
$ReportsStopWatch.Reset()
bertalan_ronai
4 years agoAdvocate I
Thanks! Wow, that Stopwatch feature is really useful.