Azure App Service allows you to configure an external Git repository from which it can pull down code from. This works for both Web Sites and Function Apps, and can be configured as part of your ARM template.

But once you’ve configured the location of the external repository, simply pushing new commits to that external git repository won’t cause your website/function app to automatically update.

Instead you need to go into the Deployments section of the portal and click the Sync button:

When you click sync, it pulls down any new commits from the external git repository, and deploys them for you.

But how can we automate this process? We don’t want to have to manually go into the portal as part of our deployment. Here’s two ways I found…

Method 1 – PowerShell

The first technique uses Azure PowerShell. I’ll assume you’re already logged in and have the correct subscription selected. You can use these commands to do that if you’re new to Azure PowerShell.

About Mark Heath

I'm a Microsoft MVP and software developer based in Southampton, England, currently working as a Software Architect for NICE Systems. I create courses for Pluralsight and am the author of several open source libraries. I currently specialize in architecting Azure based systems and audio programming. You can find me on: