I'm currently working with some key vault secrets, and I'm trying to see if it is any way that we can pass some of the secrets into parameters inside of Azure pipelines. Does anyone has any idea of how to do this?
Asked
Active
Viewed 1,270 times
1
-
Please check this MS document : https://learn.microsoft.com/en-us/azure/devops/pipelines/release/azure-key-vault?view=azure-devops – RahulKumarShaw Dec 09 '21 at 06:27
-
And what the issue you have? – Krzysztof Madej Dec 09 '21 at 10:02
1 Answers
0
These are the steps to solve this issue:
Add keyvault under the azure portal
Inside of your pipeline, you should click in the following options Library > + Variable Group > Add a name > Choose the option called "Link secrets from an Azure Key vault as variables" > Choose azure subscription > Choose Key Vault name > Choose your secret.
In the pipeline itself you will need to add the following code:
parameters:
- name: TokenDev
displayName: Token
type: string
default: keyvault
values:
- keyvaultdev
- kevaultprod
variables:
- name: privateToken
value: ${{parameters.TokenDev}}
- To call the secret inside of the variable, you just need to do the following:
$(private) [whatever name you provide to the secret]
If you want to learn more about Parameters, I will recommend you to click in here.

Hvaandres
- 755
- 2
- 12
- 39