Azure Git deploy into site folder not wwwroot Azure Git deploy into site folder not wwwroot azure azure

Azure Git deploy into site folder not wwwroot


This is not very well supported today, but you may be able to make it work by setting a couple things in the app settings:

SCM_REPOSITORY_PATH=..\repositorySCM_TARGET_PATH=..

This basically tells it to put the repo directly in VirtualDirectory0 (as opposed to VirtualDirectory0\site), and then to deploy to VirtualDirectory0\site (as opposed to VirtualDirectory0\site\wwwroot).

This assumes that your repo contains a folder named wwwroot.

Some info on these paths here


I found a solution that seems to work perfectly and allows a bit more control over what gets copied, overwritten, etc because it uses xcopy directly. Given a git project with wwwroot and myapp (in my case they are in the root) you can use a deployment batch file to copy those folders to the wwwroot and a folder above. The solution came from this article:

1.) Create two files in your git root:

.deployment

[config]command=deploy.cmd 

deploy.cmd

@echo offecho ---Deploying siteREM ---Deploy the wwwroot folder in repository to default target (wwwroot)xcopy %DEPLOYMENT_SOURCE%\wwwroot\* %DEPLOYMENT_TARGET% /Y /s REM ---Deploy the myapp folder in repository to folder above default target (wwwroot\..\myapp)xcopy %DEPLOYMENT_SOURCE%\myapp\* %DEPLOYMENT_TARGET%\..\myapp /Y /s 

2.) Commit, push, smile


had the same issue referred to this post a couple of times did it wrong a couple of times but got it to work.

SOLUTION

  1. Using an ftp like filezila, ftp connect to your website and create a your app folder under the site folder, such as site/myapp
  2. on azure management portal select your azure website you want to deploy to
  3. under configuration tab scroll down to app settings
  4. set the key SCM_TARGET_PATH to ..\myapp
  5. TAKE NOTE OF THE forward slash \ NOT backslash /