Publishing function app from GitHub folder

For very simple functions, I really liked just hacking them in the Azure portal. This is super brittle, however, since changes that break the app can't be undone. Great for learning, not so much once you start depending on those functions.

While you can deploy using GitHub Actions and Azure Pipelines, both seem a massive leap in complexity from the beauty of in-portal editing and updating. Kudu (or App Service build service) is way simpler and generally sufficient for simple functions. You just select GitHub as the source:

And App Service build service as the build provider:

You next simply connect it to your GitHub repository and that's it. But what if you want to deploy a subfolder from the repository as the function app?

Turns out you can just add an application setting to the function app, named DEPLOYMENT_SOURCE, pointing to the right subfolder (i.e. .\redir or .\api in my case) and that's it! Here you can see it in action in the logs, where just the redir subfolder is being sync'ed to the wwwroot for the function app:

Last updated