In a previous blogpost I explained how to setup a docker build which allows to connect to an authorized Azure Devops Artifacts feed. I often use this feed, as it contains packages which we don’t want to share in public. However, almost every single time when I start fiddling around with my private feed, things break. Badly:
Response status code does not indicate success: 401 (Unauthorized).
Although I was pretty sure that the FEED_ACCESSTOKEN, which is required for correct authentication, was correctly set in my environment file, the docker-build still falled back to an old value.
Emptying the cache, deleting images: nothing helped. It appeared that I had set the environment variable for this same FEED_ACCESSTOKEN on system-level as well. Apparently, the global environment variable takes precedence over the locally set variable.
Two solutions are possible here:
- run $env:FEED_ACCESSTOKEN =”” before you run your actual build
- simply delete the FEED_ACCESSTOKEN from your environment variables.
Thanks for reading another episode of “Once bitten, twice shy.”