# 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](https://docs.microsoft.com/en-us/azure/azure-functions/functions-how-to-github-actions?tabs=javascript) and [Azure Pipelines](https://docs.microsoft.com/en-us/azure/azure-functions/functions-how-to-azure-devops?tabs=csharp), both seem a massive leap in complexity from the beauty of in-portal editing and updating. [Kudu](https://docs.microsoft.com/en-us/azure/app-service/deploy-continuous-deployment#option-1-kudu-app-service) (or *App Service build service*) is way simpler and generally sufficient for simple functions. You just select GitHub as the source:

![](https://804009323-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5W22ESTtVWB8uBjgpA%2Fuploads%2Fgit-blob-1ca305fd4380ac9c98edea22b07e4eec44b7eb32%2Fimage%20\(10\).png?alt=media)

And App Service build service as the build provider:

![](https://804009323-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5W22ESTtVWB8uBjgpA%2Fuploads%2Fgit-blob-94c1347c4be1f59e0ead29004b1c0fa255ecc033%2Fimage%20\(6\).png?alt=media)

You next simply connect it to your GitHub repository and that's it. But what if you want to deploy a [subfolder](https://github.com/kzu/azdo/tree/main/redir) 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:

![](https://804009323-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5W22ESTtVWB8uBjgpA%2Fuploads%2Fgit-blob-146fda12fcd0ca638e4375f677bc592f9f779a93%2Fimage%20\(11\).png?alt=media)
