Deploy Azure Functions from an external GIT repository (manual push)

In this short blog post, I have a look at the possibility to deploy Azure Functions from an external GIT repository. In my specific example, the repository is located in a DevOps repo in a different tenant. If the DevOps instance would be in the same tenant we could actually connect it using the full CI/CD functionality where your changes are pushed automatically using webhooks. But since this is not the case I had a closer look at the very easy deployment using “External GIT”.

Although the update in this case is only manual and at the push of a sync-button, which is perfectly sufficient in my case. This might be the use-case for an Azure Function running in your customers tenant but the source code is kept in your companies DevOps.

Configure Deployment

We start the setup in the Azure Portal. In the fist step navigate to your Azure Function and go to the Deployment Center.

image 12

In this Deployment Center you can find various possibilities to sync your Azure Function with some kind of repository. Here we use the probably easiest, but manual way to sync the app using a private “External Git” repository.

Deploy Azure Functions from an external GIT repository

To access the repository, we need to create the appropriate credentials.

Generate GIT credentials

To create these credentials we browse to our repository in DevOps and hit the Clone button.

image 13

Here we could now generate the Git credentials we will use to authenticate from our deployment.

image 2
image 3

We use this information to fill in the required fields in the Deployment Center, so move back to the Azure Portal.

image 14
That’s it, now save the changes and the Azure Function will build from your repository.

Sync repository

Whenever you change your code, you could now hit the Sync button to fetch the Azure Function from the repository and rebuild it.

image 7

This is how you could deploy Azure Functions from an external GIT repository.

... is a technical consultant and developer at Comsol Unternehmenslösungen AG in Kronberg/Taunus. Major tasks are the architecture and implementation of complex, usually cross-system applications in and around Microsoft Dynamics 365 Business Central.

Leave a Reply

Your email address will not be published. Required fields are marked *