<?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: PowerShell Login with Connect-PowerBIServiceAccount +ServicePrincipal error in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/PowerShell-Login-with-Connect-PowerBIServiceAccount/m-p/1088713#M23667</link>
    <description>&lt;P&gt;Forget about my message. I found the solution. Everything is now running fully as expected&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 14 May 2020 01:24:16 GMT</pubDate>
    <dc:creator>MawashiKid2</dc:creator>
    <dc:date>2020-05-14T01:24:16Z</dc:date>
    <item>
      <title>PowerShell Login with Connect-PowerBIServiceAccount +ServicePrincipal error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerShell-Login-with-Connect-PowerBIServiceAccount/m-p/1088530#M23663</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am currently testing PowerShell scripts in combination with Power BI REST API which I intend to use in automation scenarios.&lt;/P&gt;&lt;P&gt;At this stage, all tests were successfully completed manually through Windows PowerShell console.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The login option I used was&amp;nbsp;Connect-PowerBIServiceAccount.&lt;BR /&gt;&lt;BR /&gt;So to make a long story short, running&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;Connect-PowerBIServiceAccount&lt;/LI-CODE&gt;&lt;P&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;will generate a prompt asking for user to login. After entering my credentials, script then runs perfectly, executing all defined code blocks, returning expected data results. Still that's not quite sufficient for automation as I need to find a way to remove prompt process. One suggestion was to use Service Principal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now if I try to run the same&amp;nbsp;Connect-PowerBIServiceAccount method with Service Principal, the following authentication block seems to run fine&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;Connect-PowerBIServiceAccount -ServicePrincipal -CertificateThumbprint XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -ApplicationId XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&lt;/LI-CODE&gt;&lt;P&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;&amp;nbsp;though it just stalls returning a 403 forbidden status code whenever I try to run any subsequent methods. So something's obviously broken in the authentication process and I don't believe it's strictly relatated to PowerShell.&amp;nbsp;&lt;BR /&gt;Any tested and&amp;nbsp; working POC on how to cope with this would be deeply appreciated.&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 20:49:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerShell-Login-with-Connect-PowerBIServiceAccount/m-p/1088530#M23663</guid>
      <dc:creator>MawashiKid2</dc:creator>
      <dc:date>2020-05-13T20:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell Login with Connect-PowerBIServiceAccount +ServicePrincipal error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerShell-Login-with-Connect-PowerBIServiceAccount/m-p/1088713#M23667</link>
      <description>&lt;P&gt;Forget about my message. I found the solution. Everything is now running fully as expected&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 01:24:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerShell-Login-with-Connect-PowerBIServiceAccount/m-p/1088713#M23667</guid>
      <dc:creator>MawashiKid2</dc:creator>
      <dc:date>2020-05-14T01:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell Login with Connect-PowerBIServiceAccount +ServicePrincipal error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerShell-Login-with-Connect-PowerBIServiceAccount/m-p/1380992#M25794</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am doing some automation using&amp;nbsp;&lt;SPAN&gt;PowerShell script with Power BI REST API. And, I came across your post.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you share the solution to overcome&amp;nbsp;&amp;nbsp;403 forbidden status for subsequent call?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 19:38:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerShell-Login-with-Connect-PowerBIServiceAccount/m-p/1380992#M25794</guid>
      <dc:creator>yandra</dc:creator>
      <dc:date>2020-09-18T19:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell Login with Connect-PowerBIServiceAccount +ServicePrincipal error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerShell-Login-with-Connect-PowerBIServiceAccount/m-p/2291164#M33964</link>
      <description>&lt;P&gt;What was the solution&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/218578"&gt;@MawashiKid2&lt;/a&gt;&amp;nbsp;?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 13:19:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerShell-Login-with-Connect-PowerBIServiceAccount/m-p/2291164#M33964</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-19T13:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell Login with Connect-PowerBIServiceAccount +ServicePrincipal error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/PowerShell-Login-with-Connect-PowerBIServiceAccount/m-p/2422550#M35206</link>
      <description>&lt;P&gt;The solution is to use an SPN (&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/register-app?tabs=customers%2CAzure" target="_blank"&gt;Register an app to embed Power BI content in a Power BI embedded analytics application - Power BI | Microsoft Docs&lt;/A&gt;). Once you have an SPN your code will change to:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#replace bold items with your values&lt;BR /&gt;$applicationId = "&lt;STRONG&gt;&amp;lt;guid&amp;gt;&lt;/STRONG&gt;";&lt;BR /&gt;$securePassword = "&lt;STRONG&gt;&amp;lt;password&amp;gt;&lt;/STRONG&gt;" | ConvertTo-SecureString -AsPlainText -Force&lt;BR /&gt;$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $applicationId, $securePassword&lt;BR /&gt;Connect-PowerBIServiceAccount -ServicePrincipal -Credential $credential -TenantId "&lt;STRONG&gt;&amp;lt;tenantid-guid&amp;gt;&lt;/STRONG&gt;"&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 21:07:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/PowerShell-Login-with-Connect-PowerBIServiceAccount/m-p/2422550#M35206</guid>
      <dc:creator>rockymtnrajah</dc:creator>
      <dc:date>2022-03-28T21:07:50Z</dc:date>
    </item>
  </channel>
</rss>

