Skip to content

The Azure.Core library in DbaTools 2.7.21 is preventing use of Connect-AzAccount (Az module version 5.3.2) #42

@draugrimm

Description

@draugrimm

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

WARNING: Unable to acquire token for tenant 'organizations' with error 'Method not found: 'Void Azure.Core.TokenRequestContext..ctor(System.String[], System.String, System.String, System.String, Boolean, Boolean, System.String, System.Uri, System.String)'.'
Connect-AzAccount: Method not found: 'Void Azure.Core.TokenRequestContext..ctor(System.String[], System.String, System.String, System.String, Boolean, Boolean, System.String, System.Uri, System.String)'.

Steps to Reproduce

Connect-AzAccount

Please confirm that you are running the most recent version of dbatools

2.7.21

Other details or mentions

Uninstalling dbatools and opening a fresh terminal causes the command to work.

Connect-AzAccount failure case:
The Azure.Core version that gets loaded when dbatools is present is 1.41.0.0 from location:
C:\Users\username\Documents\PowerShell\Modules\dbatools.library\2025.12.28\core\lib\Azure.Core.dll

Connect-AzAccount success case:
The Azure.Core version that gets loaded when dbatools is NOT present is 1.50.0.0 from location:
C:\Users\username\Documents\PowerShell\Modules\Az.Accounts\5.3.2\lib\netstandard2.0\Azure.Core.dll

What PowerShell host was used when producing this error

PowerShell Core (pwsh.exe)

PowerShell Host Version

Name Value


PSVersion 7.5.4
PSEdition Core
GitCommitId 7.5.4
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

SQL Server Edition and Build number

N/A

.NET Framework Version

.NET 9.0.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions