cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

PowerShell Login with Connect-PowerBIServiceAccount +ServicePrincipal error

Hi,

I am currently testing PowerShell scripts in combination with Power BI REST API which I intend to use in automation scenarios.

At this stage, all tests were successfully completed manually through Windows PowerShell console. 

The login option I used was Connect-PowerBIServiceAccount.

So to make a long story short, running   

 

 

 

Connect-PowerBIServiceAccount

 

 

 

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

 

Now if I try to run the same Connect-PowerBIServiceAccount method with Service Principal, the following authentication block seems to run fine

 

 

 

Connect-PowerBIServiceAccount -ServicePrincipal -CertificateThumbprint XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -ApplicationId XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

 

 

 

 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. 
Any tested and  working POC on how to cope with this would be deeply appreciated.

Thank you 

  


 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: PowerShell Login with Connect-PowerBIServiceAccount +ServicePrincipal error

Forget about my message. I found the solution. Everything is now running fully as expected😊🌟🌟🌟

View solution in original post

1 REPLY 1
Highlighted
Frequent Visitor

Re: PowerShell Login with Connect-PowerBIServiceAccount +ServicePrincipal error

Forget about my message. I found the solution. Everything is now running fully as expected😊🌟🌟🌟

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.