Azure DevOps Pipelines

Learn how to easily manage environment variables for your Azure DevOps Pipelines.

This guide will show you how to use Doppler to provide secrets to pipelines in Azure DevOps.


Azure DevOps Environment

Create a custom Azure DevOps environment so CI/CD secrets are maintained separately from application secrets.


Service Tokens

Create a Doppler Service Token for the Azure DevOps config and copy it to your clipboard.

Then in Azure DevOps, go to your pipeline Variables > + (new variable) and add a new variable DOPPLER_TOKEN using the token content copied to the clipboard.

Check the Keep this value secret option, then click Ok to save the variable.

Your Azure DevOps pipeline will now be able to access all the secrets in that Doppler config on each job run.



Now, let's create a simple pipeline to show you how to use the Doppler CLI in your pipeline scripts.

First install the Doppler CLI, then inject secrets as environment variables into your build script or commands using the doppler run command.

  - main

  vmImage: ubuntu-latest

  - script: |
      (curl -Ls --tlsv1.2 --proto "=https" --retry 3 || wget -t 3 -qO- | sudo sh
    displayName: Install Doppler CLI

  - script: doppler run -- ./bin/ # Replace with your build command or script
    displayName: Build


The env field is required for scripts using the Doppler CLI as secret variables must be explicitly mapped to environment variables.

Save the pipeline and run it. The Azure DevOps pipeline job shows the successful installation of the CLI and fetching of a secret.



Amazing Work!

Now you know how to configure Azure DevOps pipelines to fetch secrets from Doppler.