Forum Discussion
(PowerShell) Connect-PowerBIServiceAccount not working
- 5 years ago
Problem found and solved!
It turned out that an update to the PowerShell extension for VS Code set this value "powershell.useX86Host": true. In other words, it started running 32 bit as default. Manually changing it back to x64 like shown in the screenshots belov solved the problem:
Cheers, Mike
Hi alexgor87,
If you do not change the setting on these function usage but this issue appears frequently. It means the issues may be related to some backend/remote processing of these function usages.
In my opinion, I'd like to suggest contact to the author of the packages to report this.
Regards,
Xiaoxin Sheng
Exactly my thought. We use Microsofts official PowerBi management package, so I think the best thing to do is open a ticket with their support.
- alexgor875 years ago
Advocate II
I was just about to raise the ticket, and I checked the version of the MicrosoftPowerBIMgmt package. Mine was 1.0.896, while the latest is 1.2.1026:
https://www.powershellgallery.com/packages/MicrosoftPowerBIMgmt/1.2.1026
So I updated the module and all dependent modules:
MicrosoftPowerBIMgmt.Admin (>= 1.2.1026)
MicrosoftPowerBIMgmt.Capacities (>= 1.2.1026)
MicrosoftPowerBIMgmt.Data (>= 1.2.1026)
MicrosoftPowerBIMgmt.Profile (>= 1.2.1026)
MicrosoftPowerBIMgmt.Reports (>= 1.2.1026)
MicrosoftPowerBIMgmt.Workspaces (>= 1.2.1026)
and the problem has gone! Hope this will work for you too!- h4tt3n5 years ago
Helper V
Thank you for the feedback. I have tried this solution, but unfortunately it did not solve the problem. May I ask what dev tools you are using? I am using VS code with powershell 5.1 for development.
- alexgor875 years ago
Advocate II
I was running the commands from the standard Windows PowerShell terminal (5.1) as administrator. I also have VS Code, but I don't use very complex scripts so there's nothing much to develop at the moment.
- Anonymous5 years agoNot applicable
I uninstalled the powershell module and reinstalled it again to update to the latest version.
I now receive a different error:
Login-PowerBI -Credential $credential
Login-PowerBI : One or more errors occurred.
At line:1 char:5
+ Login-PowerBI -Credential $credential
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...IServiceAccount:ConnectPowerBIServiceAccount) [Connect-PowerBIServiceAccount], AggregateException
+ FullyQualifiedErrorId : One or more errors occurred.,Microsoft.PowerBI.Commands.Profile.ConnectPowerBIServiceAccount
WARNING: (False) MSAL 4.25.0.0 MSAL.Desktop Microsoft Windows NT 10.0.19042.0 [08/26/2021 08:30:16 - a8595795-2a3c-4957-a9c1-289ad9698d27] Request retry failed.
WARNING: (False) MSAL 4.25.0.0 MSAL.Desktop Microsoft Windows NT 10.0.19042.0 [08/26/2021 08:30:16 - a8595795-2a3c-4957-a9c1-289ad9698d27] Exception type: Microsoft.Identity.Client.MsalUiRequ
iredException
, ErrorCode: invalid_grant
HTTP StatusCode 400
CorrelationId a8595795-2a3c-4957-a9c1-289ad9698d27WARNING: (False) MSAL 4.25.0.0 MSAL.Desktop Microsoft Windows NT 10.0.19042.0 [08/26/2021 08:30:16 - a8595795-2a3c-4957-a9c1-289ad9698d27] Exception type: Microsoft.Identity.Client.MsalUiRequ
iredException
, ErrorCode: invalid_grant
HTTP StatusCode 400
CorrelationId a8595795-2a3c-4957-a9c1-289ad9698d27at Microsoft.Identity.Client.OAuth2.OAuth2Client.ThrowServerException(HttpResponse response, RequestContext requestContext)
at Microsoft.Identity.Client.OAuth2.OAuth2Client.CreateResponse[T](HttpResponse response, RequestContext requestContext)
at Microsoft.Identity.Client.OAuth2.OAuth2Client.<ExecuteRequestAsync>d__11`1.MoveNext()