Am working on Azure DevOps and Azure KeyVault. Here, am trying to login my Azure account using KeyVault secrets in Azure DevOps Pipelines. For that I followed the Link-1 which is used for fetching the secrets. All the setup is done properly and for checking it, I taken PowerShell task with Inline script as shown in figure where Password is KeyVault Secret:
When the Build is run, it's runned without any error. But, here am getting KeyVault secrets(Password) values as following:
After that, when I tried it for further steps by adding some code for login purpose am getting the error as following: Could you please suggest me how to get out of this situation
$securePassword = "$(Password)" | ConvertTo-SecureString -AsPlainText -Force
? based on the error you may need to doube quote the variable. – Thomas