<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: API DataflowUnauthorizedError when trying to update a Dataflow although all permissions are set in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/API-DataflowUnauthorizedError-when-trying-to-update-a-Dataflow/m-p/4050856#M54252</link>
    <description>&lt;P&gt;Hey&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since I wanted to perform the API call non-interactively, I think I have no options. Thank you very much again!&lt;/P&gt;</description>
    <pubDate>Fri, 19 Jul 2024 13:58:19 GMT</pubDate>
    <dc:creator>gtzanakis</dc:creator>
    <dc:date>2024-07-19T13:58:19Z</dc:date>
    <item>
      <title>API DataflowUnauthorizedError when trying to update a Dataflow although all permissions are set</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/API-DataflowUnauthorizedError-when-trying-to-update-a-Dataflow/m-p/4048335#M54230</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the following script trying to update the &lt;EM&gt;computeEngineBehavior&amp;nbsp;&lt;/EM&gt;of a Dataflow of mine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#!/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&amp;amp;client_id=$CLIENT_ID&amp;amp;client_secret=$CLIENT_SECRET&amp;amp;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"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run it, I'm getting the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"error":{"code":"DataflowUnauthorizedError","message":"You do not have permissions to manage this dataflow."}}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. I have double-checked all environmental variables regarding the workspace &amp;amp; dataflow IDs, secrets, etc.&lt;/P&gt;&lt;P&gt;2. My Service Principal has Admin access to this workspace&lt;/P&gt;&lt;P&gt;3. My Service Principal has "Dataflow.ReadWrite.All" (and, in fact, almost every permission under the sun) in its API permissions section&lt;/P&gt;&lt;P&gt;4. If I modify my script to POST a refresh request, it works great&lt;/P&gt;&lt;P&gt;5. I can perform this type of request with my personal credentials&amp;nbsp;when using the "Try it" button in &lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/dataflows/update-dataflow?tryIt=true&amp;amp;source=docs#code-try-0" target="_self"&gt;the corresponding API documentation page&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anybody explain to me why I'm getting this error and how I can fix it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gtzanakis_0-1721300126452.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1134519i14B15266F151F853/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gtzanakis_0-1721300126452.png" alt="gtzanakis_0-1721300126452.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 10:58:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/API-DataflowUnauthorizedError-when-trying-to-update-a-Dataflow/m-p/4048335#M54230</guid>
      <dc:creator>gtzanakis</dc:creator>
      <dc:date>2024-07-18T10:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: API DataflowUnauthorizedError when trying to update a Dataflow although all permissions are set</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/API-DataflowUnauthorizedError-when-trying-to-update-a-Dataflow/m-p/4050088#M54247</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/453028"&gt;@gtzanakis&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Service principal only supports some read-only admin APIs. Since you mentioned that POST requests for refreshing dataflows work, you might need to use &lt;STRONG&gt;personal credentials&lt;/STRONG&gt; or a different authentication method for update operations.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal#considerations-and-limitations" target="_blank"&gt;Embed Power BI content in an embedded analytics application with service principal and an application secret&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vyiruanmsft_0-1721374399729.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1135078i59E4200BC4C1A618/image-size/large?v=v2&amp;amp;px=999" role="button" title="vyiruanmsft_0-1721374399729.png" alt="vyiruanmsft_0-1721374399729.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/admin/metadata-scanning-enable-read-only-apis#supported-apis" target="_self"&gt;Supported APIs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Service/PBI-Service-Dataset-refresh-fail-DataflowUnauthorizedError/m-p/1610681" target="_blank"&gt;Solved: PBI Service, Dataset refresh fail - DataflowUnauth... - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Got an answer from the support.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;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.&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 07:35:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/API-DataflowUnauthorizedError-when-trying-to-update-a-Dataflow/m-p/4050088#M54247</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-19T07:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: API DataflowUnauthorizedError when trying to update a Dataflow although all permissions are set</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/API-DataflowUnauthorizedError-when-trying-to-update-a-Dataflow/m-p/4050856#M54252</link>
      <description>&lt;P&gt;Hey&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since I wanted to perform the API call non-interactively, I think I have no options. Thank you very much again!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 13:58:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/API-DataflowUnauthorizedError-when-trying-to-update-a-Dataflow/m-p/4050856#M54252</guid>
      <dc:creator>gtzanakis</dc:creator>
      <dc:date>2024-07-19T13:58:19Z</dc:date>
    </item>
  </channel>
</rss>

