Use az webapp deployment source to deploy code from git but when the app is in a git repository subfolder

I’m trying to deploy code from my gitlab CI runner to Azure. I’m using the az webapp deployment to do the job:

az webapp deployment source config --branch master --manual-integration --name [myWebApp] --repo-url [git url] --app-working-dir [folder] --resource-group [myResourceGroup]

But there is a problem, the default working directory is the git ‘s root folder. My application is inside a child folder from root. I check the command configuration and I saw --app-working-dir which does what I want, again, but only works if --cd-project-url is set (I don’t need and I’m not using VSTS). Also, there is no example available of using this config. I’m looking to have a command set similar to what I used when deploying via azure cloud shell: cd <app-folder>; az webapp up --sku B1 --name <app-name>. There is a way to do the deploy in a simpler form?


Create a .deployment file in your root directory of your git repository. And add the project sub folder in the configuration. It will work then.