question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Az.Accounts newer then 1.9.5 incompatible with partnercenter module

See original GitHub issue

Steps to reproduce

Please see this error report: https://github.com/Azure/azure-powershell/issues/14288

With Az.Accounts 2.1.0 or higher installed run:

Connect-AzAccount

After login run

Import-Module partnercenter

Expected behavior

Module gets imported silently

Actual behavior

Import-Module partnercenter
Import-Module: Assembly with same name is already loaded

Diagnostic logs

 Import-Module partnercenter -Debug
VERBOSE: Loading module from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\partnercenter.psd1'.

Confirm
Continue with this operation?
[Y] Yes  [A] Yes to All  [H] Halt Command  [S] Suspend  [?] Help (default is "Y"): a
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Store.PartnerCenter.PowerShell.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Store.PartnerCenter.PowerShell.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Store.PartnerCenter.Azure.Billing.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Store.PartnerCenter.Azure.Billing.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Store.PartnerCenter.Azure.Subscription.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Store.PartnerCenter.Azure.Subscription.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Graph.Beta.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Graph.Beta.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Graph.Core.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Graph.Core.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Extensions.Caching.Abstractions.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Extensions.Caching.Abstractions.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Extensions.Caching.Memory.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Extensions.Caching.Memory.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Extensions.DependencyInjection.Abstractions.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Extensions.DependencyInjection.Abstractions.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Extensions.Options.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Extensions.Options.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Extensions.Primitives.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Extensions.Primitives.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Identity.Client.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Identity.Client.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Identity.Client.Extensions.Msal.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Identity.Client.Extensions.Msal.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.IdentityModel.JsonWebTokens.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.IdentityModel.JsonWebTokens.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.IdentityModel.Logging.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.IdentityModel.Logging.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.IdentityModel.Tokens.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.IdentityModel.Tokens.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Rest.ClientRuntime.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Rest.ClientRuntime.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Store.PartnerCenter.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Store.PartnerCenter.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\System.Runtime.CompilerServices.Unsafe.dll'.
VERBOSE: Loading 'Executable' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\System.Runtime.CompilerServices.Unsafe.dll'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\Users\Ax\Documents\PowerShell\Modules\partnercenter\3.0.10\Microsoft.Store.PartnerCenter.PowerShell.format.ps1xml'.
Import-Module: Assembly with same name is already loaded

Environment

Name                           Value
----                           -----
PSVersion                      7.1.2
PSEdition                      Core
GitCommitId                    7.1.2
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
nathan-given-health-catalystcommented, Nov 30, 2021

Hello, I’m running into this same issue. PS 7.2 PartnerCenter 3.0.10 Az.Accounts 2.6.2

Is the only workaround to downgrade az.accounts?

Update: I installed az.accounts 1.9.5 side-by-side with az.accounts 2.6.2 and I installed az.compute 4.5.0 side-by-side with az.compute 4.17.0 and by importing those explicit, older az modules I was able to get my stuff working.

0reactions
nathan-given-health-catalystcommented, Apr 12, 2022

I’m running into this issue as well. I can install Az.Accounts 1.9.5 to get around the issue, but my script also requires Az.KeyVault to run, which automatically installs a more recent version of Az.Accounts.

I had to start using explicit import-module statements with -RequiredVersion parameter to get it to work. YMMV

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix Az.accounts in powershell as its not loading the ...
This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see | https ...
Read more >
How to fix incompatible versions between Az.Websites and ...
I receive this error Az.Websites\3.0.1\Az.Websites.psm1 : This module requires Az.Accounts version 2.12.4. An earlier version of Az.Accounts ...
Read more >
[error]Could not find the modules: 'Az.Accounts' with Version
I have a release Pipeline in which I use Azure PowerShell to deploy artifacts into AppServices in Azure. It was working fine around...
Read more >
PartnerCenter Module
Adds a customer user to a specified role. Connect-PartnerCenter. Connect to Partner Center with an authenticated account for use with partner cmdlet requests....
Read more >
module conflict when both the older AzureRM and newer ...
Recommendation is to not run AzureRM modules and Az modules in the same Automation account. It's best to fully commit to a complete...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found