Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Invoke-ASCmd] ERROR: Could not load type 'Microsoft.Identity.Client.BaseAbstractApplicationBuilder`1' from assembly 'Microsoft.Identity.Client, Version=4.27.0.0, Culture=neutral, PublicKeyToken= #88

Open
TymonCzarnota opened this issue Jul 8, 2024 · 9 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@TymonCzarnota
Copy link

Hey 😄

When running:

 [xml] $results = Invoke-ASCmd `
        -Credential $credential `
        -ServicePrincipal `
        -TenantId $azr_svc_tenant_id `
        -InputFile Model_Tabular.xmla `
        -Server $apiUrl `
        2>&1

on version 22.3.0, we are getting following error :

ERROR: Could not load type 'Microsoft.Identity.Client.BaseAbstractApplicationBuilder`1' from assembly 'Microsoft.Identity.Client, Version=4.27.0.0, Culture=neutral, PublicKeyToken=

Code was run from CircleCi and GithubActions and was working fine for older versions. We tried to run the code on different windows runners with the same outcome.

As a workaround we downgraded to 22.2.0 for now

Is this a know issue? Thanks for support 😄

@Matteo-T
Copy link
Collaborator

Matteo-T commented Jul 9, 2024

Hi @TymonCzarnota, not known to me. It looks like I some dependency is missing. Are you running into this issue in both PS5.1 and PS7? What versions of PowerShell7 are you on, if the issue happen in PS7?

I'll look into this ASAP and see if I can quickly push out a v22.3.1 with a fix (and also understand why this was not caught when I ran the automation tests).

@Matteo-T Matteo-T self-assigned this Jul 9, 2024
@Matteo-T Matteo-T added the bug Something isn't working label Jul 9, 2024
@Matteo-T Matteo-T added this to the v22.3.1 milestone Jul 9, 2024
@TymonCzarnota
Copy link
Author

Hey, we've only run it on 5.1, did not test it on PS7. Thanks for the support 😄

@Matteo-T
Copy link
Collaborator

Could you share the version of Az.* cmdlets you happen to have in your machine? Specifically, the Az.Accounts... Is it the latest version (3.0.0)? If it isn't, could you update it and see if the issue goes away. I'm still trying to setup an Azure AS in the meanwhile...

@TymonCzarnota
Copy link
Author

We are using a windows-latest image from github actions, which seems to come with version 2.1.0 pre-installed. I tried to update to latest (3.0.1 released a day ago 🤔 ), but problem remains. Will try to tinker some more with versions. @Edgar-Kalkowski how does it look like on CircleCi front?

@Edgar-Kalkowski
Copy link

On CircleCI Get-Module -ListAvailable -Refresh does not show Az.Accounts as being installed at all. Is it a dependency of the SqlServer module?

@Edgar-Kalkowski
Copy link

I tried anyway to install version 3.0.1 of Az.Accounts but I still get the same error.

@Matteo-T
Copy link
Collaborator

@Edgar-Kalkowski / @TymonCzarnota - I do not see anything in the SQLServer module that is referencing that (ancient) Microsoft.Identity.Client, Version=4.27.0.0.

Is it possible you have some other (old) module loaded in the PoweShell.exe process, which may be interfering?

[System.AppDomain]::CurrentDomain.GetAssemblies() | Where-Object { $_.Location -like '*Microsoft.Identity.Client.dll' } | ForEach-Object { $_.Location }

Once thing you can try could be to make sure you Import-Module SQLServer before any other (or at least before the one that is loading the old Microsoft.Identity.Client.

@SnehilMittal-gep
Copy link

Hi @Matteo-T, Facing the same issue.

This is something related to SqlServer Version 22.3.0.

We isolated and tried lower version of SqlServer 22.2.0. It worked.

We added below command in script to try lower version - @TymonCzarnota You can try this as a temporary workaround.

Get-Module SqlServer -ListAvailable
Remove-Item (Get-Module -ListAvailable SQLServer*).Path
Install-Module SqlServer -RequiredVersion 22.2.0 -AllowClobber -Confirm:$false -Force
Get-Module SqlServer -ListAvailable

@Edgar-Kalkowski
Copy link

We did some more investigation of this and it turns out that we were missing an explicit Import-Module SqlServer in our code. Before version 22.3.0 it seems everything worked even without the import. Since that version the import seems to be required to make sure the correct other assemblies are loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants