Skip to content Skip to sidebar Skip to footer

Azure Pipeline Environment Variables Failing

I have the following yaml pipeline build file: pr: branches: include: - master jobs: - job: 'Test' pool: vmImage: 'Ubuntu-16.04' strategy: matrix: Pyth

Solution 1:

I don't know if you still need this but... If you take a look at the documentation here it says:

Unlike a normal variable, they are not automatically decrypted into environment variables for scripts. You can explicitly map them in, though.

So it looks like you were doing it right. Maybe try using a different name for the mapped variable. It could be the name of the initial encrypted variable is confounding the mapping (because it's already a variable it won't remap it).

Solution 2:

To make the environment variable available in the Python script, you need to define it in the step where it's used:

-script:|
      pip install pytest
      pytest tests -s --doctest-modules --junitxml=junit/test-results.xml
displayName:'pytest'env:POSTGRES:$(POSTGRES)

Post a Comment for "Azure Pipeline Environment Variables Failing"