-
Notifications
You must be signed in to change notification settings - Fork 216
Closed
Description
Issue Description
Starting with Microsoft.Graph.Authentication 2+ there is a dependency conflict with azure powershell. Az.Attestation as well as this module both deliver Microsoft.IdentityModel.Tokens.dll as a dependency and they are not compatible. Depending which of the two modules has been loaded/imported/used first, the other one breaks.
Powershell code that deals with Az and Mg is quite common in project doing Azure provisioning via powershell which makes this quite "unpleasent" to say the least.
Symptoms
Connect-MgGraph fails with the following error:
Connect-MgGraph: Invalid JWT access token.
Repro
docker run -it mcr.microsoft.com/powershell:ubuntu-22.04
Install-Module -Name Az.Attestation -RequiredVersion 2.0.0 -Force
Install-Module -Name Microsoft.Graph.Authentication -RequiredVersion 2.0.0-preview5 -AllowPrerelease -Force
Import-Module -Name Az.Attestation -Version 2.0.0
Import-Module -Name Microsoft.Graph.Authentication -Version 2.0.0
Connect-MgGraphsukkerfri and helplessJ