This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
When I use PowerShell (via DevOps) to call the refreshSchedule operation it fails:
Messages - One or more errors occurred.
Inner Exception - Response status code does not indicate success: 400 (Bad Request).
# Create credentials for Service Principal
$ServicePrincipalCredentials = New-Object System.Management.Automation.PSCredential ($ApplicationId, (convertto-securestring $ClientSecret -asplaintext -force))
# Login to Power BI
Connect-PowerBIServiceAccount -Credential $ServicePrincipalCredentials `
-Tenant $TenantId `
-Environment Public `
-ServicePrincipal
# Example schedule
[string]$body = "{""value"":{""times"":[""16:00""],""Enabled"":""true""}}"
# Construct Rest API URL
[string]$Url = "groups/$($WorkspaceId)/datasets/$($dataset.id)/refreshSchedule"
# Call Rest API
Invoke-PowerBIRestMethod -Url $Url -Method Patch -ContentType "application/json" -Body $bodyWhen I print the variables to the screen and copy and paste them in the Try It section of the documentation it always works without errors. Tried serveral ways to construct the body (different messages, different string constructions). Before this Rest API call I have at least a dozen other PBI Rest API call and they all work without errors.... Any suggestions?
Solved! Go to Solution.
Unfortunately is seems that a Service Principal cannot perform this action. You need a Service Account (AAD account) for this.
Hi @jvanrossum ,
Please refer to this post:
400 Bad Request Error when embedding report
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply, but I'm not sure how that post helps solving my problem. They have the same general error message, but that problem is about embedded.
Unfortunately is seems that a Service Principal cannot perform this action. You need a Service Account (AAD account) for this.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 11 | |
| 8 | |
| 8 | |
| 7 | |
| 7 |
| User | Count |
|---|---|
| 50 | |
| 27 | |
| 24 | |
| 24 | |
| 22 |