Connect-PowerBIServiceAccount: issue connecting
See original GitHub issueI 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:
- Created 5 years ago
- Comments:8
Top Related StackOverflow Question
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.
Update to Connect-PowerBIServiceAccount -Credential was released in https://www.powershellgallery.com/packages/MicrosoftPowerBIMgmt/1.0.342