0
votes

My goal is to create an automated build/release pipeline that updates an Azure site every time I merge code in the GitHub project with the website.


I have a website in GitHub. A VSTS GitHub build task builds it successfully. A VSTS release task (Deploy Azure App Service) deploys the site to an Azure web app successfully. I know this because the Azure App Service Editor for the Azure app shows the website files in a subdirectory under wwwroot. Because the files are deployed to a subdirectory rather than directly to wwwroot, the site won't load. (To make sure the files themselves were not the problem, I manually added the same files in wwwroot by generating new files with the built-in command prompt and copy/pasting in each file's content, and the site loaded fine.)

I have edited the release definition and created new releases many times but cannot figure out how to deploy directly to wwwroot. Everything else in the pipeline works, including the automatic triggers.

The subdirectory's name matches the name of the build artifact download shown in the "Run on Agent" pane of the release definition. It also matches the name in the "Source Alias" field of the artifact used at the beginning of the release pipeline.

$(System.DefaultWorkingDirectory)/ is in the Package or folder field of the Deploy Azure App Service configuration settings.

How can I deploy the site to wwwroot? Thank you for any insights.

1
Take a screenshot of your settings. By default the Deploy Azure App Service should work fine with the defaults. It sounds like you might have specified a virtual application in the config?Brendan Green
Your comment prompted me to look at the settings again - thank you @BrendanGreenhcdocs

1 Answers

1
votes

$(System.DefaultWorkingDirectory)/ was incorrect in the "Package or folder" field of the "Deploy Azure App Service" configuration settings. To resolve:

  • Select the ... button next to "Package or folder."
  • Select the subdirectory beneath the "Linked artifacts" directory (in my case, the name of the subdirectory is the same as the "Source alias" in the Artifact settings pane).

I incorrectly had selected "Linked artifacts."

What threw me off is that you select a subfolder to deploy to root, and you select the root linked artifact to deploy to a subfolder.