question

ErfanNariman-5893 avatar image
0 Votes"
ErfanNariman-5893 asked AbhijitBadve-7408 commented

Azure functions use ssh to access private github repo

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


This way we install our private modules.

But how would we do this on an Azure functions where we have git+ssh://git@github.com/org-name/package-name.git in our requirements.txt together with other open source packages like requests==2.24.0. I am not sure how to add ssh to our function app.

Or is there a better solution for this?

azure-functions
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

PramodValavala-MSFT avatar image
0 Votes"
PramodValavala-MSFT answered AbhijitBadve-7408 commented

I believe there is no provision to setup an ssh-key for remote builds.

The alternate would be to either use local build or setup CI/CD Pipeline in Azure Devops or Github Actions to perform the build and deploy to Azure Functions.


· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

That actually makes sense, will try it with GitHub Actions, thanks.

0 Votes 0 ·

Did this solution work for you? We are running into a similar issue. @PramodValavala-MSFT how do we use github actions which has requirements.txt with dependency on a private repo ( git+ssh)? We are using Azure/functions-action but somehow we get error with pip-install on Oryx build step.

0 Votes 0 ·

@AbhijitBadve-7408 You would have to install the required SSH private keys using an action like webfactory/ssh-agent when working with private repositories.


0 Votes 0 ·
Show more comments