0
votes

enter image description hereWhat I should do to run the Azure powershell commands against release pipeline. When i try to run the Azure powershell command in the "Inline Azure Powershell" i am getting below error.

##[error]The term 'Get-AzKeyVaultSecret' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

I am using Hosted agent provided by the Azure pipeline

1

1 Answers

3
votes

There has 2 method.

Suggest you use Azure Powershell Task and change to Inline type.

First method is change the Azure Powershell Task version to 4.*. In 4.*, we build-in the Az.KeyVault module. And it will download the corresponding dll to support this command use.

enter image description here


Or you can continue to use 1.* version task. Just run

Install-Module Az.KeyVault

command firstly to prepare the environment.