Connect-PowerBIServiceAccount: issue connecting

See original GitHub issue

I am trying connecting in PS using the cmd: Connect-PowerBIServiceAccount -Environment Public -Credential (Get-Credential) -ServicePrincipal

I tried with my account, PowerBI Admin for our tenant and I am getting error.

When looking at the details, it’s like the domain part @domainname.com has got removed.

Here are the details: PS C:\WINDOWS\system32> Connect-PowerBIServiceAccount -Credential (Get-Credential) -ServicePrincipal cmdlet Get-Credential at command pipeline position 1 Supply values for the following parameters: Connect-PowerBIServiceAccount : One or more errors occurred. At line:1 char:1

  • Connect-PowerBIServiceAccount -Credential (Get-Credential) -ServicePr …
  •   + CategoryInfo          : WriteError: (Microsoft.Power...IServiceAccount:ConnectPowerBIServiceAccount) [Connect-PowerBIServiceAccount], AggregateException
      + FullyQualifiedErrorId : One or more errors occurred.,Microsoft.PowerBI.Commands.Profile.ConnectPowerBIServiceAccount
    
    

PS C:\WINDOWS\system32> Resolve-PowerBIError -Last

HistoryId: 43

Message : AADSTS70001: Application with identifier ‘adm-blabla’ was not found in the directory analysis.windows.net Trace ID: 2dd34999-9fd3-4521-863b-22e8ac011c00 Correlation ID: 36c2570a-5452-4ee9-bafd-23bd11409a57 Timestamp: 2018-09-10 14:49:34Z StackTrace : at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Http.AdalHttpClient.<GetResponseAsync>d__221.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Http.AdalHttpClient.<GetResponseAsync>d__211.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenHandlerBase.<SendHttpMessageAsync>d__72.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenHandlerBase.<SendTokenRequestAsync>d__69.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenHandlerBase.<CheckAndAcquireTokenUsingBroker>d__59.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Flows.AcquireTokenHandlerBase.<RunAsync>d__57.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenForClientCommonAsync>d__33.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.<AcquireTokenAsync>d__59.MoveNext() Exception : Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException InvocationInfo : {Connect-PowerBIServiceAccount} Line : Connect-PowerBIServiceAccount -Credential (Get-Credential) -ServicePrincipal Position : At line:1 char:1 + Connect-PowerBIServiceAccount -Credential (Get-Credential) -ServicePr … + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 43

Message : Response status code does not indicate success: 400 (BadRequest). StackTrace : Exception : System.Net.Http.HttpRequestException InvocationInfo : {Connect-PowerBIServiceAccount} Line : Connect-PowerBIServiceAccount -Credential (Get-Credential) -ServicePrincipal Position : At line:1 char:1 + Connect-PowerBIServiceAccount -Credential (Get-Credential) -ServicePr … + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 43

Message : {“error”:“unauthorized_client”,“error_description”:“AADSTS70001: Application with identifier ‘adm-blabla’ was not found in the directory analysis.windows.net\r\nTrace ID: 2dd34999-9fd3-4521-863b-22e8ac011c00\r\nCorrelation ID: 36c2570a-5452-4ee9-bafd-23bd11409a57\r\nTimestamp: 2018-09-10 14:49:34Z”,“error_codes”:[70001],“timestamp”:“2018-09-10 14:49:34Z”,“trace_id”:“2dd34999-9fd3-4521-863b-22e8ac011c00”,“correlation_id”:“36c2570a-5452-4ee9-bafd-23bd11409a57”}: Unknown error StackTrace : Exception : Microsoft.IdentityModel.Clients.ActiveDirectory.AdalException InvocationInfo : {Connect-PowerBIServiceAccount} Line : Connect-PowerBIServiceAccount -Credential (Get-Credential) -ServicePrincipal Position : At line:1 char:1 + Connect-PowerBIServiceAccount -Credential (Get-Credential) -ServicePr … + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 43

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
CodeCyclonecommented, Sep 10, 2018

We don’t support passing user crendentials in that cmdlet when -ServicePrincipal switch is added. This is meant for AAD App-Only authentication where you create an AAD application, with the username being the client ID of the AAD application and the password is the secret key of the AAD application. Power BI APIs currently don’t support App-Only authentication but that is actively being worked on. So the PowerShell cmdlets are ahead of the curve on this.

We are considering adding support for passing in user credentials into the cmdlet (where -ServicePrincipal isn’t specified). Or exposing a switch parameter to force device code authentication.

0reactions
CodeCyclonecommented, Dec 1, 2018

Update to Connect-PowerBIServiceAccount -Credential was released in https://www.powershellgallery.com/packages/MicrosoftPowerBIMgmt/1.0.342

Read more comments on GitHub >

github_iconTop Results From Across the Web

(PowerShell) Connect-PowerBIServiceAccount not working
1) Close all open powershell sessions. Go to C:\Program Files\WindowsPowerShell\Modules and delete all MicrosoftPowerBIMgmt modules (folders) manually · 2) Open ...
Read more >
PowerBIServiceAccount powershell command is not working
I've recently been experiencing an issue with connecting PowerShell to Power BI. I've tried using the following commands, but all of them are...
Read more >
Connect-PowerBIServiceAccount Will Not Connect
I have been struggling to connect to Power BI through PowerShell. If I use 'Login-PowerBI' and then select my username and stored password ......
Read more >
Automating Power BI deployments: Connecting to the service
The Connect-PowerBIServiceAccount cmdlet lets you pass a Credential parameter (username and password or service principal), but it requires ...
Read more >
PowerShell Cmdlets for Power BI: What is it? And Why ...
To use the Power BI Cmdlets, first, you need to log in to Power BI using Connect-PowerBIServiceAccount Cmdlet as below;
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found