Environment variables in Pipeline

I have a private package on a private PyPI. Using the page from the docs I put the following in requirements.txt:

--extra-index-url https://${MY_USER}:${MY_PASSWORD}@my-private-package-index-url
my-private-package

Making use of the environment variables page I can install the package in a Viktor app and use it in my app. This command:

viktor-cli start --env FOO=bar

In Azure Devops I have set these variables (MY_USER and MY_PASSWORD) on the pipeline. After uploading my code to Azure Devops, which triggers the pipeline, isntallation of my-private-package fails. I get the error messages:

ERROR: Could not find a version that satisfies the requirement my-private-package (from versions: none)
ERROR: No matching distribution found for my-private-package

It seems it wasnโ€™t able to pass my Variables with the URL.

When I tried to upload the same code with the variables as plain text, it worked like expected.
When I do an Echo in the Pipeline to call the variables I get โ€œ***โ€, indicating it can find them.

Does someone have an idea how I can get this to work?

Making use of the โ€œKeep this value secretโ€ option in Azure DevOps seems to be the problem. Adding a new Variable with the same Value passes the right value to the .txt file and the Pipeline can install my-private-package.

image

If I look at this page you could still use the variable while keeping it secret, it will require you to map it to an environment variable though.

Thank you Raoul

Adding

env:
    MY_PASSWORD: $(TEST)  #TEST is the variable I shared in my second screenshot

to the Pipeline before the pip install of the requirements.txt fixed my issue.