How do I configure an Azure Function App to authenticate to an Azure Artifact Feed with pip?

Viewed 21

I have a Python project that I want to deploy to an Azure Function App. The project has a dependency on a package that's available from a private Azure Artifact Feed.

I can build the project locally by setting the --index-url flag in my requirements.txt to the artifact feed and authenticating with artifact-keyring. I just had to add my user as an owner, although I assume being a reader would have worked as well. When I try to deploy the project from Visual Studio Code or from the Azure CLI, the deployment hangs on the pip installation. I assume that pip is waiting for authentication.

Does anyone know how to configure authentication for Azure Function Apps, pip, and an Azure Artifact Feed so that a project can be deployed via the Azure CLI?

1 Answers

Navigate to your Function App in Azure, and select Configurations from the left-hand blade.

Under Application Settings add: Key | Value PIP_EXTRA_INDEX_URL | URL to Index from Artifact Feed (i.e https://pkgs.dev.azure.com/....)

Finally in your requirements.txt file add the package: package-name==0.1.5

When you deploy your function app you'll see it's able to find the index (however it will get stuck because it needs to authenticate).

This is where you need basic authetication or a pip authentica

Related