Search code examples
azure-functionsazure-functions-core-tools

How to point Azure Function publish to custom python registry?


How do I point the Azure Function publish function of Azure Function Core Tools to a custom registry such as an enterprise ArtiFactory instance?

Example:

  • When running func azure functionapp publish <FunctionAppName>, how do I get requirements.txt to install from a registry I choose rather than pypi?
  • Very similar to changing npm's default registry.

Solution

  • The command runs pip install, so any environment variables pip looks for will work.

    • If you need all your modules from the custom registry, set PIP_INDEX_URL
    • If you need just some of your modules, then set PIP_EXTRA_INDEX_URL

    Note that the func azure functionapp publish <FunctionAppName> command performs a Remote Build by default. So, you would have to set the required environment variable as an app setting.

    Optionally, you could perform a local build by running func azure functionapp publish <FunctionAppName> --build local.

    Also, you could also set the same configuration in pip's config file for local builds.