<?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: Power Bi REST API - 401 Authorization error when using app secret in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/595143#M18114</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/96676"&gt;@tripleacoder&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your requirements are quite clear now. You'd like to use the App secret (aka client secret) instead of the user password authentication. I'm afraid this isn't workable in Power BI. The reason is simple. Even the global admin can't access other's contents. How can an App access everything?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Dale&lt;/P&gt;</description>
    <pubDate>Fri, 04 Jan 2019 10:10:23 GMT</pubDate>
    <dc:creator>v-jiascu-msft</dc:creator>
    <dc:date>2019-01-04T10:10:23Z</dc:date>
    <item>
      <title>Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/588468#M17950</link>
      <description>&lt;P&gt;I have a console app that uses the REST API to get a dataset (and later add rows to it). This works when I supply my own user/password credentials.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I have registered the app as a Web/API app in order to use an app key/secret instead. I can get a token, but when I make the same REST call I get 401 Unauthorized.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have given the app the following Application permissions in Power BI Service (is this needed?):&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Read and write all content in tenant&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;View all content in tenant&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;These permissions have been granted by an Azure Administrator.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition to the Delegated permissions that worked with user authentication:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Read and write all Datasets&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;View all Datasets&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have decode the two tokens.&lt;/P&gt;&lt;P&gt;The token for app key autentication contains this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;"roles": [&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"Tenant.ReadWrite.All",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"Tenant.Read.All"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;],&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;while the token for user based authentication contains this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;"scp": "Dataset.ReadWrite.All Workspace.ReadWrite.All",&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing..?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 12:24:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/588468#M17950</guid>
      <dc:creator>tripleacoder</dc:creator>
      <dc:date>2018-12-19T12:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/588538#M17953</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/96676"&gt;@tripleacoder&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you try to mention an access level&amp;nbsp;in API request?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/embedtoken/reports_generatetoken#tokenaccesslevel" target="_self"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/embedtoken/reports_generatetoken#tokenaccesslevel&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Ruslan&lt;BR /&gt;-------------------------------------------------------------------&lt;BR /&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 13:19:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/588538#M17953</guid>
      <dc:creator>zoloturu</dc:creator>
      <dc:date>2018-12-19T13:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/588544#M17954</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you try to mention an access level&amp;nbsp;in API request?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/embedtoken/reports_generatetoken#tokenaccesslevel" target="_self"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/embedtoken/reports_generatetoken#tokenaccesslevel&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I'm not sure what you mean. The link goes to "&lt;SPAN&gt;Required access level for EmbedToken generation", but I'm not using the Embed Token API.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I get the token using this code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;const string authorityUri = "https://login.microsoftonline.com/" + tenantId;

AuthenticationContext authContext = new AuthenticationContext(authorityUri);

        
AuthenticationResult result = null;
         
result = await authContext.AcquireTokenAsync(resourceUri, clientCredential);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 13:28:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/588544#M17954</guid>
      <dc:creator>tripleacoder</dc:creator>
      <dc:date>2018-12-19T13:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/588562#M17955</link>
      <description>&lt;P&gt;I found this link:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal#assign-the-application-to-a-role" target="_blank"&gt;https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal#assign-the-application-to-a-role&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It talks about assigning roles to the app.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have now granted my app the Contributor role, but only on a Resource group.&lt;/P&gt;&lt;P&gt;It hasn't helped. I think the Poer BI service resides at the Subscription level... that means I will need help from a global admin again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 15:02:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/588562#M17955</guid>
      <dc:creator>tripleacoder</dc:creator>
      <dc:date>2018-12-19T15:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/591329#M18005</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/96676"&gt;@tripleacoder&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems you only need an access token. Please refer to&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/get-azuread-access-token" target="_self"&gt;developer/embed-sample-for-customers&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Dale&lt;/P&gt;</description>
      <pubDate>Wed, 26 Dec 2018 08:11:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/591329#M18005</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2018-12-26T08:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/593559#M18074</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/96676"&gt;@tripleacoder&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: 'Segoe UI'; font-size: 10.5pt; color: #333333;"&gt;Could you please mark the proper answers as solutions?&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt; color: #333333;"&gt;Best Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt; color: #333333;"&gt;Dale&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jan 2019 07:22:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/593559#M18074</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2019-01-02T07:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/594020#M18088</link>
      <description>&lt;P&gt;I had a simliar issue where i could use my own credentials but not the service account and the issue was the service account didnt have a power bi pro license. Not sure if thats the same issue but might be worth looking at&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jan 2019 19:31:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/594020#M18088</guid>
      <dc:creator>sjc4062</dc:creator>
      <dc:date>2019-01-02T19:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/594379#M18096</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/28904"&gt;@v-jiascu-msft&lt;/a&gt;&amp;nbsp;wrote:&lt;P class="1546507018867"&gt;&amp;nbsp;&lt;/P&gt;&amp;nbsp;&lt;P&gt;It seems you only need an access token. Please refer to&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/get-azuread-access-token" target="_self"&gt;developer/embed-sample-for-customers&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That link talks about using a special user account (username + password) for the app, not an app secret/service principal, which is what I am trying to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, I have been told elsewhere that roles are not needed in order to authorize service principals. Only "App permissions" are needed.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 09:23:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/594379#M18096</guid>
      <dc:creator>tripleacoder</dc:creator>
      <dc:date>2019-01-03T09:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/594382#M18097</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/42931"&gt;@sjc4062&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I had a simliar issue where i could use my own credentials but not the service account and the issue was the service account didnt have a power bi pro license. Not sure if thats the same issue but might be worth looking at&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That might be it. But when I go to assign licenses and search for the service principal it does not come up in the results. Not sure if it is getting filtered away because only users and groups are valid, or if it's because I am not an Azure global admin.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 09:25:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/594382#M18097</guid>
      <dc:creator>tripleacoder</dc:creator>
      <dc:date>2019-01-03T09:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/595143#M18114</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/96676"&gt;@tripleacoder&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your requirements are quite clear now. You'd like to use the App secret (aka client secret) instead of the user password authentication. I'm afraid this isn't workable in Power BI. The reason is simple. Even the global admin can't access other's contents. How can an App access everything?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Dale&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 10:10:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/595143#M18114</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2019-01-04T10:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/595263#M18122</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/28904"&gt;@v-jiascu-msft&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your requirements are quite clear now. You'd like to use the App secret (aka client secret) instead of the user password authentication. I'm afraid this isn't workable in Power BI. The reason is simple. Even the global admin can't access other's contents. How can an App access everything?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;Thanks. This MS sample posts data to a custom Web API using the same method (but with a custom role):&lt;/P&gt;&lt;P&gt;&lt;A href="https://azure.microsoft.com/en-us/resources/samples/active-directory-dotnet-daemon/" target="_blank"&gt;https://azure.microsoft.com/en-us/resources/samples/active-directory-dotnet-daemon/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you explain a bit more why that won't work with the Power BI REST API? Perhaps also with a link to some documentation...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The app has the permission (=role) "&lt;SPAN&gt;Tenant.ReadWrite.All" which I supposed was for this purpose.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 14:43:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/595263#M18122</guid>
      <dc:creator>tripleacoder</dc:creator>
      <dc:date>2019-01-04T14:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/595828#M18141</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/96676"&gt;@tripleacoder&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as I know, the permissions of Power BI are all based on the users. So an App can't act as a user. Please refer to&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/power-bi-permissions" target="_self"&gt;developer/power-bi-permissions&lt;/A&gt;&amp;nbsp;where all the descriptions have "user".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding "Tenant.ReadWrite.All", the documentation above also has a&amp;nbsp;description. Actually, these permissions only can retrieve the profiles rather than data. Please refer to&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/admin/reports_getreportsasadmin" target="_self"&gt;admin/reports_getreportsasadmin&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;One simple proof we can see is that even an admin can't access all the App workspaces. The data is the precious asset of a company. I think this is reasonable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Dale&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 03:02:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/595828#M18141</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2019-01-07T03:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/634564#M18663</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/28904"&gt;@v-jiascu-msft&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;can any power bi pro user register an app for power bi in the below link. I have a user who is power bi admin, and he cant register an app. It throws some error related to access when registering thru this&amp;nbsp;&lt;A href="https://dev.powerbi.com/apps" target="_blank" rel="noopener"&gt;dev.powerbi.com/apps&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/register-app" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/register-app&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Can u help&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 19:47:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/634564#M18663</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-28T19:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/634638#M18665</link>
      <description>&lt;P&gt;Most organization have app registrations locked down pretty tight. I am not familiar with that tool for app registration, but I don't imagine it is meant to be a workaround for corporate security restrictions, and I would expect it to fail for most users within most Azure tenants.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 22:46:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/634638#M18665</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-28T22:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/670852#M19136</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting&amp;nbsp;a same error&amp;nbsp;Failed to load resource: the server responded with a status of 401 when I try to open dashboard URL in new tab&amp;nbsp;&lt;A href="https://app.powerbi.com/dashboardEmbed?dashboardId=100114d8-9c7c-4ae1-b1d5-291603b4f22c&amp;amp;config=eyJjbHVzdGVyVXJsIjoiaHR0cHM6Ly9XQUJJLVVLLVNPVVRILUItUFJJTUFSWS1yZWRpcmVjdC5hbmFseXNpcy53aW5kb3dzLm5ldCJ9" target="_blank"&gt;https://app.powerbi.com/dashboardEmbed?dashboardId=100114d8-9c7c-4ae1-b1d5-291603b4f22c&amp;amp;config=eyJjbHVzdGVyVXJsIjoiaHR0cHM6Ly9XQUJJLVVLLVNPVVRILUItUFJJTUFSWS1yZWRpcmVjdC5hbmFseXNpcy53aW5kb3dzLm5ldCJ9&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works fine on localhost sample dashboard app (C# visual studio 2017)&lt;/P&gt;&lt;P&gt;I am also getting this error on console for&amp;nbsp;&lt;A href="https://api.powerbi.com/powerbi/metadata/refreshusermetadata" target="_blank"&gt;https://api.powerbi.com/powerbi/metadata/refreshusermetadata&lt;/A&gt;&lt;/P&gt;&lt;P&gt;When i open this link it shows message. See the screenshot below :&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-center" image-alt="service.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/159114iB85F61AAD9ECDE5A/image-size/large?v=v2&amp;amp;px=999" role="button" title="service.png" alt="service.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dashboard URL should also work on a new tab too because I want to use this link into another website&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me, I am trying to find a solution for this now for two days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2019 08:42:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/670852#M19136</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-16T08:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/818463#M21103</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am also geeting the same error when accessing power BI rest API's. I am able to generate token but not proceeding further. Can you please paste your code, which ran successfully exclusive of all tennat id and username and pwd.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/96676"&gt;@tripleacoder&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I have a console app that uses the REST API to get a dataset (and later add rows to it). This works when I supply my own user/password credentials.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I have registered the app as a Web/API app in order to use an app key/secret instead. I can get a token, but when I make the same REST call I get 401 Unauthorized.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have given the app the following Application permissions in Power BI Service (is this needed?):&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Read and write all content in tenant&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;View all content in tenant&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;These permissions have been granted by an Azure Administrator.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition to the Delegated permissions that worked with user authentication:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Read and write all Datasets&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;View all Datasets&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have decode the two tokens.&lt;/P&gt;&lt;P&gt;The token for app key autentication contains this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;"roles": [&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"Tenant.ReadWrite.All",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"Tenant.Read.All"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;],&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;while the token for user based authentication contains this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;"scp": "Dataset.ReadWrite.All Workspace.ReadWrite.All",&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing..?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/96676"&gt;@tripleacoder&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I have a console app that uses the REST API to get a dataset (and later add rows to it). This works when I supply my own user/password credentials.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I have registered the app as a Web/API app in order to use an app key/secret instead. I can get a token, but when I make the same REST call I get 401 Unauthorized.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have given the app the following Application permissions in Power BI Service (is this needed?):&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Read and write all content in tenant&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;View all content in tenant&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;These permissions have been granted by an Azure Administrator.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition to the Delegated permissions that worked with user authentication:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Read and write all Datasets&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;View all Datasets&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have decode the two tokens.&lt;/P&gt;&lt;P&gt;The token for app key autentication contains this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;"roles": [&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"Tenant.ReadWrite.All",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"Tenant.Read.All"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;],&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;while the token for user based authentication contains this:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;"scp": "Dataset.ReadWrite.All Workspace.ReadWrite.All",&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing..?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 14:17:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/818463#M21103</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-15T14:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/971569#M22668</link>
      <description>&lt;P&gt;This doesn't make any sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Power BI released all of this documentation saying that consumers could use service principals to embed reports but we can't use service principals to list the reports in a workspace that the service principal is an admin member of?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 02:33:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/971569#M22668</guid>
      <dc:creator>boylec</dc:creator>
      <dc:date>2020-03-13T02:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/1277614#M25105</link>
      <description>&lt;P&gt;Why does the sample code for the power bi embedded 'app owns data' scenario use the client credentials route when it is not supported?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 13:59:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/1277614#M25105</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-06T13:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/1313895#M25376</link>
      <description>&lt;P&gt;My teammate been trying to get REST API to work as well but also encounter the same 401 error message. Is this still an on-going issue or there is a solution we can apply?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 08:59:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/1313895#M25376</guid>
      <dc:creator>ironmanwk</dc:creator>
      <dc:date>2020-08-21T08:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Power Bi REST API - 401 Authorization error when using app secret</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/2094844#M32004</link>
      <description>&lt;P&gt;This is all fine except for one thing: You have to &lt;EM&gt;infer&lt;/EM&gt; the "user Apps only" status of Power BI dataflows.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something explicit along these lines would have saved me the better part of a week chasing my tail.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 15:13:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-Bi-REST-API-401-Authorization-error-when-using-app-secret/m-p/2094844#M32004</guid>
      <dc:creator>lysdexia</dc:creator>
      <dc:date>2021-09-23T15:13:21Z</dc:date>
    </item>
  </channel>
</rss>

