-
Notifications
You must be signed in to change notification settings - Fork 173
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
Assembly conflict between Az.Account and Microsoft.Graph.Authentication in PowerShell 5.1 #2148
Comments
Additionally - if the module import order is reversed, Az cmdlets don't work
|
This issue is similar to #2147 |
This also impacts the Azure DevOps Pipeline agents unfortunately |
We are impacted by this as well in our pipelines. Haven't found a solution yet.. |
We are also impacted, our script is using the "New-MgGroupOwnerByRef -GroupId $groupId -BodyParameter " command. UPDATE: |
Thanks for bringing this to our attention, and sorry for any inconvenience caused in your upgrade from v1.x to v2.x. Our preliminary investigation points to an assembly conflict with the latest version of As workaround, you can consider the following options as we further investigate and try to get to the root cause of the conflict:
PS C:\> Import-Module Az.Accounts -RequiredVersion 2.12.1 # Rollback to Az.Accounts 2.12.1
PS C:\> Import-Module Microsoft.Graph.Authentication
PS C:\> Get-MgApplication
Get-MgApplication : Authentication needed. Please call Connect-MgGraph. |
@peombwa thanks for responding. Do you know if we have a workaround for this issue in AzurePowerShell@5 task? |
You can try updating - task: AzurePowerShell@5
inputs:
azureSubscription: '$(AZURE_SUBSCRIPTION)'
azurePowerShellVersion: LatestVersion
ScriptType: 'InlineScript'
pwsh: true # Set to true to use PowerShell 7.
Inline: |
Connect-MgGraph ... You can also use |
We’ve just shipped v2.1.0, which should address the assembly conflict with the latest versions of Az modules in PowerShell 5.1. Please update to v2.1.0 and let us know if it resolves the issue - https://github.com/microsoftgraph/msgraph-sdk-powershell/releases/tag/2.1.0. |
I have confirmed this is work although with some limitations:
I have not found any other issue yet. ~LvdW |
Thanks for this information. I was having issues with Az and Graph commands even after the update in |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
For those who cannot immediately upgrade to Mg 2.1.0 and are looking at using Powershell Core in their ADO pipelines instead as a workaround, please be aware of an open problem with the AzurePowerShell@5 task under pwsh 7.3 - Service Connections configured to use client certificate authentication cannot be used, because the task incorrectly passes a file path internally to openssl.exe. Apart from that issue, I can confirm that Az 9.6.0 and Mg 2.0.0 work in perfect harmony in our pipelines under pwsh. |
I was originally bought here from this issue #2161 I wasn't too happy with pinning a version to this install IF Powershell 5.x was the issue (as suggested: Install-Module Microsoft.Graph -RequiredVersion 2.1.0 -Force -AllowClobber) so I went down the route of adding pwsh:true to the AzurePowerShell@5 pipeline task - which was an excellent suggestion. When running on an Azure DevOps hosted pipeline agent using "windows-latest" however, for some reason the Microsoft.Graph module isn't installed for use with PowerShell 7 (like it was with PowerShell 5) so I have to install the module as part of the deployment now - which adds another 20 MINUTES to the runtime whilst it installs it - despite mentions the overall time would be reduced - it's actually increased! #134 All this to run a single "Update-MgApplication" in my pipeline - what a price to progress eh? |
I didn't have a chance to reply earlier. Thanks for fixing this! I can confirm that I don't see the same issue with v2.1.0 (with possible limitation)
|
Still having the issue on Windows Powershell 5.1. Get-InstalledModule yields this:
A script that uses both Az and MSGraph that I am now trying to run can be found here: It fails with
I have tried running Update-Module on both Az and Graph. I have also tried to install .NET Framework 4.8.1 and 7.0, no effect. |
I had this issue for months. Finally found that the Azure.core dll was being loaded by the SQLServer powershell module. I removed the SQLServer ps module and Graph authentication has been working perfectly so far. |
Describe the bug
There seems to be an assembly conflict when using Az and Microsoft.Graph 2.0.0 Powershell modules in the same session. This was not a problem with the previous version of Microsoft.Graph Powershell. Brief investigation shows that this might be an issue with incompatible Azure.Identity (or Azure.Core) dll introduced in 2.0.0 version of Microsoft.Graph Powershell.
This is quite an problem for us as we need to use Powershell 5.1 and the mentioned modules together.
It doesn't look like the fix below solves the issue.
#1880
#1894
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Debug Output
Bad outcome
Expected outcome
Module Version
Environment Data
Additional Context
The text was updated successfully, but these errors were encountered: