<?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 How to Upload DataFlow via Custom Azure Web Function in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/How-to-Upload-DataFlow-via-Custom-Azure-Web-Function/m-p/2922958#M39900</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been trying to write an Azure Web Function (in C#) that can upload DataFlow to PowerBI, but uploading a DataFlow is blocked at every turn.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[1] I've used a Registered App (ClientId + ClientSecret) via&amp;nbsp;PublicClientApplicationBuilder which has worked in so far. It authenitcates without issue, able to see Workspaces and create Workspaces, assign users, but cannot Upload a DataFlow. This login type is denied by the API for reasons..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[2] There is maybe a way of using a registered app to upload 'On Behalf' of a user, but this I have not gotten working either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[3] If I attempt to use User Credentials (Username, Password) to login, this is blocked by Multi-Factor Authentication&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[4] The most promising approach I have is to use Azure CLI to login (user login) via PowerShell, copy the bearer token, and use that to get a login. The&amp;nbsp;PowerBIClient seems to get created okay, but I get 'Forbidden' when accessing the Groups, code which works with an App Reg login.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var tokenCredentials = "xxxx" //Bearer Token Sourced from Azure CLI, 'Az Login' &lt;BR /&gt;var powerBIAPIURL = "https://analysis.windows.net/powerbi/api/.default";&lt;BR /&gt;var powerBIClient = new PowerBIClient(new Uri(powerBIAPIURL), tokenCredentials);&lt;BR /&gt;try {&lt;BR /&gt;var groups = await _powerBIClient.Groups.GetGroupsAsync($"name eq '{workspaceName}'");&lt;BR /&gt;...&lt;BR /&gt;} catch (HttpOperationException) {&lt;BR /&gt;&lt;BR /&gt;Microsoft.Rest.HttpOperationException: 'Operation returned an invalid status code 'Forbidden''&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm confused by the number of paths and that each one is seemingly arbitrarily blocked. Which path is the right one? And how do I get past these blockers.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Nov 2022 03:05:37 GMT</pubDate>
    <dc:creator>shane-ds</dc:creator>
    <dc:date>2022-11-23T03:05:37Z</dc:date>
    <item>
      <title>How to Upload DataFlow via Custom Azure Web Function</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-Upload-DataFlow-via-Custom-Azure-Web-Function/m-p/2922958#M39900</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been trying to write an Azure Web Function (in C#) that can upload DataFlow to PowerBI, but uploading a DataFlow is blocked at every turn.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[1] I've used a Registered App (ClientId + ClientSecret) via&amp;nbsp;PublicClientApplicationBuilder which has worked in so far. It authenitcates without issue, able to see Workspaces and create Workspaces, assign users, but cannot Upload a DataFlow. This login type is denied by the API for reasons..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[2] There is maybe a way of using a registered app to upload 'On Behalf' of a user, but this I have not gotten working either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[3] If I attempt to use User Credentials (Username, Password) to login, this is blocked by Multi-Factor Authentication&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[4] The most promising approach I have is to use Azure CLI to login (user login) via PowerShell, copy the bearer token, and use that to get a login. The&amp;nbsp;PowerBIClient seems to get created okay, but I get 'Forbidden' when accessing the Groups, code which works with an App Reg login.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var tokenCredentials = "xxxx" //Bearer Token Sourced from Azure CLI, 'Az Login' &lt;BR /&gt;var powerBIAPIURL = "https://analysis.windows.net/powerbi/api/.default";&lt;BR /&gt;var powerBIClient = new PowerBIClient(new Uri(powerBIAPIURL), tokenCredentials);&lt;BR /&gt;try {&lt;BR /&gt;var groups = await _powerBIClient.Groups.GetGroupsAsync($"name eq '{workspaceName}'");&lt;BR /&gt;...&lt;BR /&gt;} catch (HttpOperationException) {&lt;BR /&gt;&lt;BR /&gt;Microsoft.Rest.HttpOperationException: 'Operation returned an invalid status code 'Forbidden''&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm confused by the number of paths and that each one is seemingly arbitrarily blocked. Which path is the right one? And how do I get past these blockers.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 03:05:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-Upload-DataFlow-via-Custom-Azure-Web-Function/m-p/2922958#M39900</guid>
      <dc:creator>shane-ds</dc:creator>
      <dc:date>2022-11-23T03:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to Upload DataFlow via Custom Azure Web Function</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-Upload-DataFlow-via-Custom-Azure-Web-Function/m-p/2925618#M39931</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;HI&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/475989"&gt;@shane-ds&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Did you mean to use azure function to invoke power bi rest API? if that is the case, I'd like to suggest you to take a look at the following blog:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Developing-for-Power-BI-using-Azure-Functions-June-30-2022-11-00/ba-p/2575928" target="_blank"&gt;Developing for Power BI using Azure Functions - Ju... - Microsoft Power BI Community&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 01:35:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-Upload-DataFlow-via-Custom-Azure-Web-Function/m-p/2925618#M39931</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-24T01:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to Upload DataFlow via Custom Azure Web Function</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-Upload-DataFlow-via-Custom-Azure-Web-Function/m-p/2925932#M39936</link>
      <description>&lt;P&gt;Yes, I'm using an Azure Function to invoke the PowerBI REST API. The blog only covers Service Principal authentication, which I already understand and have working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to the following PowerBI REST API documentation page&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/imports/post-import" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-us/rest/api/power-bi/imports/post-import&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;H2&gt;Limitations&lt;/H2&gt;&lt;UL&gt;&lt;LI&gt;Dataflows with service principal aren't supported.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This is the blocker. I need it unblocked. The code I've writted verifies that Service Principals are indeed &lt;SPAN&gt;arbitrarily denied the ability to upload a DataFlows. I need an alternate means or backdoor to get around this arbitrary denial of service. Or a means of getting a user Access Token that can bypass MFA and isn't presented with 'Forbidden' whenever I try to invoke the Power BI REST API using such a token.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 04:26:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-Upload-DataFlow-via-Custom-Azure-Web-Function/m-p/2925932#M39936</guid>
      <dc:creator>shane-ds</dc:creator>
      <dc:date>2022-11-24T04:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to Upload DataFlow via Custom Azure Web Function</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-Upload-DataFlow-via-Custom-Azure-Web-Function/m-p/2946882#M40113</link>
      <description>&lt;P&gt;Thanks, but, if not here, where else can I go to get relevant support?&lt;/P&gt;</description>
      <pubDate>Sun, 04 Dec 2022 23:22:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-Upload-DataFlow-via-Custom-Azure-Web-Function/m-p/2946882#M40113</guid>
      <dc:creator>shane-ds</dc:creator>
      <dc:date>2022-12-04T23:22:35Z</dc:date>
    </item>
  </channel>
</rss>

