The Error “The ‘Get-AzKeyVaultCertificate’ command was found in the “, is an error that is seen when you are working on azure and are trying to load a module using the windows Powershell.
The error is usually seen when you are trying to install the Az.KeyVault using yaml on azure DevOps pipeline.
Given below is the snippet of the error you might get:
The 'Get-AzKeyVaultCertificate' command was found in the
The error, “The ‘Get-AzKeyVaultCertificate’ command was found in the ” is seen because the most recent iteration of the Posh-ACME module has a problem (4.15.0).
The error indicates that there is an assembly version conflict, meaning that the session already has a different version of the assembly that the Az.KeyVault module is attempting to load.
The simplest solution would be to upgrade to version of 4.15.1 as the issue is fixed in that version by the azure technical team.
To fix the error, “The ‘Get-AzKeyVaultCertificate’ command was found in the “, either upgrade to stable version 4.15.1 or run the command ‘Install-Module -Name Posh-ACME -RequiredVersion 4.14.0 -Force’ into 4.14.0 version and error would be fixed.
The simplest solution would be to upgrade to version of 4.15.1 as the issue is fixed into latest version by the Azure technical team.
Steps to fix the error “The ‘Get-AzKeyVaultCertificate’ command was found in the ” is mentioned below:
To fix this, install version 4.14.0. You can do so by following the command mentioned below:
Install-Module -Name Posh-ACME -RequiredVersion 4.14.0 -Force
Secondly, you can specify the user when installing a module in a CI/CD pipeline to prevent conflicts with other modules.
You can do so by following the example code mentioned below:
#install Az PowerShell Modules with Specific User
- task: PowerShell@2
displayName: Install PowerShell Modules (Az.Accounts, Az.KeyVault, Az.Resources, Posh-ACME)
inputs:
targetType: 'inline'
script: 'Install-Module Az.Accounts, Az.KeyVault, Az.Resources, Posh-ACME -Force CurrentUser'
Az keyVault was already installed, however the error messages indicate that it was unable to load in a pipeline to execute tasks.
To install the necessary module on a specific user and import the necessary module, you can specify the user (current user or all users).
This should help you fix the error, “The ‘Get-AzKeyVaultCertificate’ command was found in the “.
Conclusion
The error indicates that there is an assembly version conflict, meaning that the session already has a different version of the assembly that the Az.KeyVault module is attempting to load.
To fix the error, “The ‘Get-AzKeyVaultCertificate’ command was found in the “, either upgrade to stable version 4.15.1 or run the command ‘Install-Module -Name Posh-ACME -RequiredVersion 4.14.0 -Force’ into 4.14.0 version and error would be fixed.