microsoft / powerbi-powershell

PowerShell community for Microsoft PowerBI. Here you will find resources and source for PowerShell modules targeting PowerBI.
MIT License
344 stars 119 forks source link

Connect-PowerBIServiceAccount fails on assembly 'Microsoft.Identity.Client, Version=4.25.0.0 #308

Open gmeronek opened 3 years ago

gmeronek commented 3 years ago

I have confirmed that I have the latest update of the MicrosoftPowerBIMgmt library per the breaking change post here.

However, when I try to run Connect-PowerBIServiceAccount it fails with the error "Connect-PowerBIServiceAccount: One or more errors occurred. (Could not load file or assembly 'Microsoft.Identity.Client, Version=4.25.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae'. The system cannot find the file specified.)"

Running on Windows Datacenter 2016 Server, PowerShell Version 7.1.3 Here is a Get-InstalledModule list for the full picture.

image

gmeronek commented 3 years ago

Note that Login-PowerBIServiceAccount fails with same error as well.

CattieCat commented 3 years ago

Apparently you have version 4.32.1 and we require version 4.25.0. I'll look into making our module take dependency 4.25.0 or above.

On Fri, Jul 2, 2021 at 11:23 AM gmeronek @.***> wrote:

Note that Login-PowerBIServiceAccount fails with same error as well.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/microsoft/powerbi-powershell/issues/308#issuecomment-873179576, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTKWKHRSYYZ2NWUBOO2P4DTVX7ZXANCNFSM47XFEPBA .

CattieCat commented 3 years ago

As a workaround, try run your powershell with -NoProfile option if you can to see if it works

timker commented 3 years ago

Works on PSVersion 5.1.19041.1023 PSEdition Desktop

Broken on PSVersion 7.0.3 PSEdition Core

CattieCat commented 3 years ago

Works well on my powershell 7.1.3 before and after I manually installed corresponding MSAL.PS and Microsoft.Identity.Client. But on Win10 as I don't have machine on Windows Datacenter 2016 Server image

I suggest to try 1) upgrade MicrosoftPowerBIMgmt to version as shown, 2) uninstall MSAL.PS and Microsoft.Identity.Client.

divewoot commented 3 years ago

I have the same error message. The only modules listed with Get-InstalledModule is MicrosoftPowerBIMgmt* all version 1.2.1026 and the powershell version is 7.1.3. PowershellError0

CattieCat commented 3 years ago

Have you guys tried to update dependency to be 4.32.1 to see if it works for you? I don't have a repro on my side to verify.

code-Night commented 3 years ago

@CattieCat , I have tested with these versions, and I am still getting the same error. My PS version is 7.1.4. image

DocGitHub commented 2 years ago

Any update on this? I am having same issue

NowinskiK commented 2 years ago

We had the same issue yesterday. After deeper investigation it appeared that reinstallation of the module helps:

Uninstall-Module MicrosoftPowerBIMgmt
Install-Module MicrosoftPowerBIMgmt 
Import-Module MicrosoftPowerBIMgmt
mattcargile commented 2 years ago

Just installed on pwsh 7.2.4 and it is still throwing this error.

EDIT: It works with pwsh -noprofile -Command connect-powerbiserviceaccount . No idea what is happening in my profile. :-(

EDIT 2: My #Requires -Modules 'dbatools' is breaking me here.

EDIT 3. So my issue is that the dbatools module is on 4.14 while this module requires 4.25. I'll add an issue there.

sdg002 commented 1 year ago

I am facing a similar problem

My corporate workstation has Powershell core with PSVerson as 7.2.9

I managed to get past this problem by this work around:

Not a desirable work around. I would like a more robust experience.

Thanks, Sau