0

I have a python package in a private GitHub Repo. While using it locally I use

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

in the bash to install the package.

I want to use that package in my azure functions and container apps. Is there a way to add that package to the requirements file and install it? And what do I need to configure in Github so that my azure resources can access it?

I add git+https://git@github.com/org-name/package-name.git to requirements.txt of the azure function app and I am unable to run it even locally.

I get the following error:

ERROR: Error [WinError 2] The system cannot find the file specified while executing command git clone -q 'https://****@github.com/org-name/packagename.git' 
ERROR: Cannot find command 'git' - do you have 'git' installed and in your PATH?
Rebe
  • 37
  • 2
  • 12

1 Answers1

1

You can setup a CI/CD pipeline in Azure Devops or github action that :

  1. Triggers whenever there is a pull request in github master.
  2. Copy the python submodules in azure function and container apps code.

You have to package your code install allow it to be installed using

pip install git+ssh://github.com/yourprofile/project.git
Anass Kartit
  • 2,017
  • 15
  • 22
  • Thanks @Anass, if I want to pip install git+https://github.com/yourprofile/project.git will I need any authentication? any access tokens that I need to add to github? – Rebe Aug 08 '22 at 12:01
  • this can help https://stackoverflow.com/questions/4830856/is-it-possible-to-use-pip-to-install-a-package-from-a-private-github-repository – Anass Kartit Aug 08 '22 at 12:06
  • 1
    I was able to use a private package in Azure function using this method. Thanks! I had to do a couple of things in order to achieve it, but the basic idea is the same as you described above. – Rebe Aug 09 '22 at 14:11