<?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 PowerBI Embedded - Capacities Update Rest API in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/PowerBI-Embedded-Capacities-Update-Rest-API/m-p/3460258#M44807</link>
    <description>&lt;P&gt;Hi There,&lt;BR /&gt;&lt;BR /&gt;I am trying to programmatically scale up/down my embedded capacity using this rest api (&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi-embedded/capacities/update?tabs=HTTP#update-capacity-parameters" target="_blank"&gt;Capacities - Update - REST API (Azure Power BI Embedded) | Microsoft Learn&lt;/A&gt;). When I test the API within the documentation, it works as intended but trying to call the API from within my application I cannot get past the permissions error.&lt;BR /&gt;&lt;BR /&gt;My service principle application registration has all the permissions for powerbi granted.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nicmcc_0-1696446548311.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/976765i28CCFF8F26A1AEB4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nicmcc_0-1696446548311.png" alt="nicmcc_0-1696446548311.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In my application, I am obtaining an access token using my client credentials but when using that access token to call the update capacities api, I get this error:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;b'{"error":{"code":"AuthorizationFailed","message":"The client \'xxxxxx\' with object id \'xxxxxx\' does not have authorization to perform action \'Microsoft.PowerBIDedicated/capacities/write\' over scope \'/subscriptions/xxxxxx/resourceGroups/PowerBI/providers/Microsoft.PowerBIDedicated/capacities/ccpowerbi\' or the scope is invalid. If access was recently granted, please refresh your credentials."}}'&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Which specific permissions am I missing? I see in the documentation that this is the required scope but not sure exactly how to auth with this scope:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nicmcc_1-1696446722743.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/976768i3682A481ED9F8D13/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nicmcc_1-1696446722743.png" alt="nicmcc_1-1696446722743.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Wed, 04 Oct 2023 19:13:02 GMT</pubDate>
    <dc:creator>nicm-cc</dc:creator>
    <dc:date>2023-10-04T19:13:02Z</dc:date>
    <item>
      <title>PowerBI Embedded - Capacities Update Rest API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerBI-Embedded-Capacities-Update-Rest-API/m-p/3460258#M44807</link>
      <description>&lt;P&gt;Hi There,&lt;BR /&gt;&lt;BR /&gt;I am trying to programmatically scale up/down my embedded capacity using this rest api (&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi-embedded/capacities/update?tabs=HTTP#update-capacity-parameters" target="_blank"&gt;Capacities - Update - REST API (Azure Power BI Embedded) | Microsoft Learn&lt;/A&gt;). When I test the API within the documentation, it works as intended but trying to call the API from within my application I cannot get past the permissions error.&lt;BR /&gt;&lt;BR /&gt;My service principle application registration has all the permissions for powerbi granted.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nicmcc_0-1696446548311.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/976765i28CCFF8F26A1AEB4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nicmcc_0-1696446548311.png" alt="nicmcc_0-1696446548311.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In my application, I am obtaining an access token using my client credentials but when using that access token to call the update capacities api, I get this error:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;b'{"error":{"code":"AuthorizationFailed","message":"The client \'xxxxxx\' with object id \'xxxxxx\' does not have authorization to perform action \'Microsoft.PowerBIDedicated/capacities/write\' over scope \'/subscriptions/xxxxxx/resourceGroups/PowerBI/providers/Microsoft.PowerBIDedicated/capacities/ccpowerbi\' or the scope is invalid. If access was recently granted, please refresh your credentials."}}'&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Which specific permissions am I missing? I see in the documentation that this is the required scope but not sure exactly how to auth with this scope:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nicmcc_1-1696446722743.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/976768i3682A481ED9F8D13/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nicmcc_1-1696446722743.png" alt="nicmcc_1-1696446722743.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 19:13:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerBI-Embedded-Capacities-Update-Rest-API/m-p/3460258#M44807</guid>
      <dc:creator>nicm-cc</dc:creator>
      <dc:date>2023-10-04T19:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: PowerBI Embedded - Capacities Update Rest API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerBI-Embedded-Capacities-Update-Rest-API/m-p/3470425#M44877</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/517259"&gt;@nicm-cc&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to the error message, it&amp;nbsp;&lt;SPAN&gt;indicates that there is no necessary permissions to call that REST API.&amp;nbsp;Here are a few things you could check:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;Enable&amp;nbsp;&lt;STRONG&gt;Allow service principals to use Power BI APIs&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vyiruanmsft_0-1697005603068.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/979428i7B4578DA7D46F380/image-size/large?v=v2&amp;amp;px=999" role="button" title="vyiruanmsft_0-1697005603068.png" alt="vyiruanmsft_0-1697005603068.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;Add the service principal to your workspace&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vyiruanmsft_1-1697005679595.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/979430i2252580F65905048/image-size/large?v=v2&amp;amp;px=999" role="button" title="vyiruanmsft_1-1697005679595.png" alt="vyiruanmsft_1-1697005679595.png" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;LI&gt;Authorization Header: Check if the authorization header is listed correctly. Make sure there are no typos.&lt;/LI&gt;
&lt;LI&gt;Token Expiry: The Azure AD authorization token might have expired.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal" 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&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/troubleshoot-rest-api" target="_blank"&gt;Troubleshoot Power BI REST APIs - Power BI | Microsoft Learn&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 06:30:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerBI-Embedded-Capacities-Update-Rest-API/m-p/3470425#M44877</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-11T06:30:30Z</dc:date>
    </item>
  </channel>
</rss>

