Azure / Azure/azure-powershell
[Eng]: Import-module CosmosDB throwing error "Assembly with same name is already loaded" in Azure Powershell
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 54
Description
### Description
Hello,
The customers pipeline has multiple tasks :
Initial task loads the CosmosDB using the
"Install-Module -Name 'CosmosDB' -MinimumVersion '4.5.0' -Force"
Another task in the same job Imports a psd1 module, with CosmosDb as required module as follows :
RequiredModules = @(
@{ ModuleName = 'CosmosDB'; ModuleVersion = '4.5.0' }
)
the above pipeline is working well with the Azure Powershell 8.2.0.
With the latest version ( 8.3.0 ) the second task is throwing the following error: "Assembly with same name is already loaded".
The current work around is to use the 8.2.0 version.
Contributor guide
Research direction
Reproduce the pipeline using Azure PowerShell 8.3.0: run Install-Module -Name 'CosmosDB' -MinimumVersion '4.5.0' -Force, then import a psd1 module declaring CosmosDB 4.5.0 in RequiredModules. Compare the result with version 8.2.0 and investigate the module-loading path; done means the second task imports without the duplicate-assembly error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100