brent-robinson / posh-acme-azure-example

Example using the Posh-ACME PowerShell module to orchestrate TLS certificate issuance using ACME in Azure with Azure DevOps
https://medium.com/@brentrobinson5/automating-certificate-management-with-azure-and-lets-encrypt-fee6729e2b78
MIT License
30 stars 27 forks source link

The 'Get-AzKeyVaultCertificate' command was found in the | module 'Az.KeyVault', but the module could not be loaded #15

Closed ronakthamor closed 2 years ago

ronakthamor commented 2 years ago

Hi,

I am getting the below error in the pipeline step Import Certificate into Key Vault:

The 'Get-AzKeyVaultCertificate' command was found in the
     | module 'Az.KeyVault', but the module could not be loaded. For
     | more information, run 'Import-Module Az.KeyVault'.

When I try to add import module (Import-Module -Name Az.KeyVault -Force) it's giving the below error:

 | Assembly with same name is already loaded
JaakkoA commented 2 years ago

I'm getting the exact same error. Seems like there is some issue with the newest version of Posh-ACME (4.15.0) and Az.KeyVault module in Azure PowerShell tasks. I tried using the older version of Posh-ACME in my pipeline and no more errors.

Install-Module -Name Posh-ACME -RequiredVersion 4.14.0 -Force

ronakthamor commented 2 years ago

@JaakkoA Thank you for the solution. I tired with old Az.KeyVault module but the issue is with Posh-ACME.