-
Notifications
You must be signed in to change notification settings - Fork 189
When recent Az.* modules are loaded, Connect-MgGraph errors out #2587
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
Comments
I've been having the exact same issue in an Azure Function app for a few days now. Been pulling my hair out trying to figure it out, so far no luck. |
Upgraded to 2.15.0, still throwing the same error. Shocked that #2594 was auto-closed, even if it was a dupe of this one. |
I just discovered the same issue with 2.15.0 with PS Core 7.4.1. It is not an issue with PS Windows 5.1
|
Upgraded to 2.16.0, still throwing the same error. |
Before I required the below modules to be imported for my script to work, never understood why as running the script manually it worked fine but it was the only way to make the script work in the runbook with a few graph commands I was using. Did some troubleshooting as I have ran against the same issue. I was able to use a hybrid worker which gave the same "entry point not found" error when using
|
Upgraded to 2.17.0, still throwing the same error. Az modules also updated:
|
When 2.15 broke with PS 7.2, I was able to successfully run with PS 5.1. Now 2.17 has broken with PS 5.1 and I'm dead in the water. |
Dude, that worked! |
Can confirm that loading Az.* modules before Microsoft.Graph.Authentication now allows for signing in with an app registration or delegated credentials. Problem still exists for scripts that import Microsoft.Graph.Authentication first. |
Upgraded to 2.18.0, problem maybe seems like it's resolved now when loading Microsoft.Graph.Authentication first. Az.* modules also got updated:
|
Problem seems to be resolved with 2.19.0 for the same versions of the Az modules listed above. |
This fixed the problem for me! |
Describe the bug
In a session where Az modules such as Az.Accounts and Az.KeyVault are loaded,
Connect-MgGraph
does not connect at all.Azure.Identity.InteractiveBrowserCredential.AuthenticateAsync(Azure.Core.TokenRequestContext, System.Threading.CancellationToken)'."
I believe the Az modules are using a newer version of MSAL that isn't compatible with the current ones included with the Graph PowerShell SDK modules. PnP v2+ couldn't happily coexist with Az modules either, until the latest release of the Az modules.
To Reproduce
Connect-MgGraph
with any authentication optionExpected behavior
Running
Connect-MgGraph
should establish a connection to Graph instead of erroring outDebug Output
When connecting with a certificate:
Module Version
Microsoft.Graph.Authentication: 2.13.1
Az PowerShell module release version is Az 11.3.0
Environment Data
PSVersion 7.4.1
PSEdition Core
GitCommitId 7.4.1
OS Microsoft Windows 10.0.22621
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
The text was updated successfully, but these errors were encountered: