Option two does not show how to manually set up the credentials. For running headless installs such as a dockerized application or perhaps installing dependencies on a build server; we need the ability to use the access token. Where did the setup for the Access Token go? It used to be on the Python page. This is no longer the case. Please update the docs to include how to do this.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
I just ran into the same problem and I agree that the docs need to fleshed out still. But in the meantime creating and using a new personal access token that had read permissions on the artifact feed worked for me.
Steps:
**Packaging** section select Read.To use the token in your virtual environment create a pip.ini/pip.conf file in your virtualenv root and paste in the suggested url with the PAT included like so:
[global]
extra-index-url=https://<your_feed>:<your_PAT>@pkgs.dev.azure.com/<your_organization>/_packaging/<your_feed>/pypi/simple/
Now pip install <package> should work without requiring user input.
You're a life saver @MaxTaggart ! Your solution just about worked for me, with a slight tweak since Devops is defaulting to project based feeds these days:
[global]
extra-index-url=https://{feed_name}:{PAT}@pkgs.dev.azure.com/{org_name}/{project_name}/_packaging/{feed_name}/pypi/simple/
The user name in the url of @jeffthink answer is not checked by the server as the user is taken from the PAT. It can be any string or empty. So it is
[global]
extra-index-url=https://:{PAT}@pkgs.dev.azure.com/{org_name}/{project_name}/_packaging/{feed_name}/pypi/simple/
It is also worth noting (troubleshooting etc) that the PyPI artifact index is available at
wget --user=_ --password={PAT} https://pkgs.dev.azure.com/{org_name}/{project_name}/_packaging/{feed_name}//pypi/simple/{artifact_name}
Here the user must be non-empty, which is wget specific, I guess.
Most helpful comment
I just ran into the same problem and I agree that the docs need to fleshed out still. But in the meantime creating and using a new personal access token that had read permissions on the artifact feed worked for me.
Steps:
**Packaging**section selectRead.To use the token in your virtual environment create a
pip.ini/pip.conffile in your virtualenv root and paste in the suggested url with the PAT included like so:Now
pip install <package>should work without requiring user input.