0
votes

We have an Azure Web App that we have Source Control integration setup with Visual Studio Online via the built in Azure functionality. This, of course, creates a build definition in our Visual Studio Online account. We have had this configured and it has worked just fine for deploying our website by queuing a build.

Our ultimate configuration is to actually create a Virtual Application and use the build to deploy to the Virtual Application instead of the web app site root.

So, we created the Virtual Application in the portal. See screenshot: screen shot of virtual application configuration

Our trouble comes in that we can't get the build definition to actually deploy to this virtual application. The build either fails or the files still end up in the site\wwwroot folder.

Our azure web app name is: inyoforum(staging)

We've tried numerous variations of the following MSBuild arguments: /p:DeployIisAppPath="inyoforum__Staging/Forum"

/p:DeployIisAppPath="inyoforum__Staging\Forum"

/p:DeployIisAppPath="inyoforum(staging)/Forum"

/p:DeployIisAppPath="inyoforum(staging)\Forum"

We even tried other variations. We tried using a publish profile instead. We can get a publish from our local Visual Studio application to the virtual application, but we've been unable to do it from the build definition.

Any suggestions on other things to try?

2

2 Answers

1
votes

You can create a publish profile to publish the website to virtual app and specify the profile in MSBuild Arguments. Steps like following:

  1. Create a publish profile according to the instruction here: Deploying multiple virtual directories to a single Azure Website.
  2. Check in the publish profile.
  3. Create a new build definition and enter following strings in MSBuild arguments:

    /p:DeployOnBuild=true /p:PublishProfile=xxxx.pubxml

  4. Queue a new build with the definition, the web app will be deployed to virtual app.

You can also install MSDeploy Package Sync task and use it to deploy to virtual app. Please refer to this article for details: CUSTOM DEPLOY TASK TO DEPLOY VIRTUAL APPLICATIONS TO AZURE

0
votes

I had this same problem and found virtual directories are not supported by MSDeploy PowerShell scripts. So I created a custom deployment task to support this use case. Give it try -

https://dotnetcatch.com/2016/03/22/vsts-release-custom-deploy-task-to-deploy-virtual-applications-to-azure/