Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Dear all,
I am using the following script trying to update the computeEngineBehavior of a Dataflow of mine.
#!/bin/bash
# Obtain access token
echo "Requesting access token..."
TOKEN_RESPONSE=$(curl -s -X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&resource=https%3A%2F%2Fanalysis.windows.net%2Fpowerbi%2Fapi" \
"https://login.microsoftonline.com/$TENANT_ID/oauth2/token")
# Extract access token from response
ACCESS_TOKEN=$(echo $TOKEN_RESPONSE | jq -r '.access_token')
if [ -z "$ACCESS_TOKEN" ] || [ "$ACCESS_TOKEN" == "null" ]; then
echo "Failed to obtain access token. Please check your credentials."
exit 1
fi
# Update the Dataflow
echo "Sending request..."
RESPONSE=$(curl -s -X PATCH \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"computeEngineBehavior": "computeDisabled"}' \
"https://api.powerbi.com/v1.0/myorg/groups/$WORKSPACE_ID/dataflows/$DATAFLOW_ID")
echo "Response: $RESPONSE"
When I run it, I'm getting the following error:
{"error":{"code":"DataflowUnauthorizedError","message":"You do not have permissions to manage this dataflow."}}
However:
1. I have double-checked all environmental variables regarding the workspace & dataflow IDs, secrets, etc.
2. My Service Principal has Admin access to this workspace
3. My Service Principal has "Dataflow.ReadWrite.All" (and, in fact, almost every permission under the sun) in its API permissions section
4. If I modify my script to POST a refresh request, it works great
5. I can perform this type of request with my personal credentials when using the "Try it" button in the corresponding API documentation page.
Can anybody explain to me why I'm getting this error and how I can fix it?
Solved! Go to Solution.
Hi @gtzanakis ,
Service principal only supports some read-only admin APIs. Since you mentioned that POST requests for refreshing dataflows work, you might need to use personal credentials or a different authentication method for update operations.
Solved: PBI Service, Dataset refresh fail - DataflowUnauth... - Microsoft Fabric Community
Got an answer from the support.
For me the problem was that i can't refreshing a dataset in a pro workspace that are getting data from dataflows in a PPU workspace. That's too bad because then PPU is kind of useless for me for now.
Best Regards
Hi @gtzanakis ,
Service principal only supports some read-only admin APIs. Since you mentioned that POST requests for refreshing dataflows work, you might need to use personal credentials or a different authentication method for update operations.
Solved: PBI Service, Dataset refresh fail - DataflowUnauth... - Microsoft Fabric Community
Got an answer from the support.
For me the problem was that i can't refreshing a dataset in a pro workspace that are getting data from dataflows in a PPU workspace. That's too bad because then PPU is kind of useless for me for now.
Best Regards
Hey @Anonymous ,
Thank you for your reply, this helps. After reading your posts, I realized I cannot use a Service Principal to update the configuration of a workflow. It says so in your screenshot as well: Dataflows management is not supported.
Since I wanted to perform the API call non-interactively, I think I have no options. Thank you very much again!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 |