1

I am migrating quite some projects from local servers to Azure functions. In these projects we use our own created Python modules which we are hosting on private GitHub repo. When developing locally or on a Ubuntu server, we can add the ssh-key to the GitHub repo and we can do:

pip install git+ssh://git@github.com/org-name/package-name.git

to install our own modules.

But how would we do this on an Azure functions where we have this in our requirements.txt. I am not sure how to add ssh to our function app.

Or is there a better solution for this?

Zal
  • 935
  • 1
  • 7
  • 17

1 Answers1

1

You can use [-e] git+ssh://git.example.com/MyProject#egg=MyProject in requirements.txt.

Reference to Requirements File Format.

Doris Lv
  • 3,083
  • 1
  • 5
  • 14
  • Does that mean that the project has to be local? If it is, than that will not work. The project is hosted on github and maintained quite often. – Zal Nov 05 '20 at 09:01
  • No, `requirements.txt` would work after deploying to azure. Doc: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-python – Doris Lv Nov 05 '20 at 09:17
  • Can you explain how azure would have access to our private repository then with ssh? Are you sure this will work? – Zal Nov 05 '20 at 09:22
  • That would take some time for testing... Here is an issue may enlighten you: https://stackoverflow.com/questions/53181349/can-i-use-pip-to-install-a-package-from-a-private-vsts-repository – Doris Lv Nov 06 '20 at 09:00