Home > front end >  Make Azure Keyvault secrets available in entire pipeline
Make Azure Keyvault secrets available in entire pipeline

Time:12-20

In order to access my secret from the keyvault, I run

        - task: AzureKeyVault@2
          inputs:
            azureSubscription: $(KEYVAULT_SC_DEV)
            KeyVaultName: $(KEYVAULT_NAME_DEV)
            SecretsFilter: APICREDENTIALS
            RunAsPreJob: true 

which works fine.

However, I have multiple jobs and am now facing the trouble of having to repeat these lines too many times.

So, is there a way to tell Azure Devops that this secret should be set globally for each job/stage/step.. etc?

CodePudding user response:

If you want these secrets available to multiple pipelines one way would be to use the library variables

enter image description here

And reference these in your pipeline Result across multiple jobs

Result across multiple stages: Result across multiple stages

CodePudding user response:

We can use "variable groups" to pass the values into a YAML pipeline, which we can make available across all.

Steps1: Store Key vault key values into Variable Groups how to use keyvault

Step2: Use that Variable group into any pipelines Here is the reference: tutorial from Thomas Thornton

  • Related