0
votes

I have a Visual Studio Solution which has multiple websites projects.

I'm currently running a build in VSTS against 1 repository which is creating a drop.zip artifact that has produced 3 websites segmented by their project/folder name.

Now I'd like to have 3 release definitions which publish each of the respective folders to Azure App Service.

How can this be done?

Inside of the Azure App Service Release step, I can only point to a single Zip file. I need to point to a folder inside the Zip the file, correct?

enter image description here

3
please see editaherrick
oh, i see what you mean, i dont know if there anything you can do except for packaging them individually, sorry4c74356b41
how do I go about packaging them up individually? i'd be fine with that approach, but can't seem to see that eitheraherrick
well, its just a zip file, you could run a script to package them individually, or your could be more careful in the build pipeline with how you package zip, i'm not sure, you would need to look at the result of the build and determine a way forward4c74356b41

3 Answers

0
votes

You could create a zip for each of you 3 websites. Publish the websites separately to 3 different build artifacts in the build pipeline.

In the release definition add all 3 artifacts in the artifacts section and deploy them to their respective Azure App service.

Build Artifacts

0
votes

It does not must be a zip file. Just as the high-lighted section in your screenshot. It could be a package file or folder. enter image description here

So for your scenario, you just need to configure the 3 release definition to link to the same build artifact. And then in the release definition add two tasks:

  1. Extract files Task - Use this task to extract the zip file
  2. Azure App Service Deploy Task - In this task, set "Package or folder" path to the extracted project folder.
0
votes

I was able to get this working by using the following MSBuild configuration:

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=false /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactstagingdirectory)" /p:DeployIisAppPath="Default Web Site" /p:Configuration=Release /p:Platform="Any CPU"

This generated a separate Zip file for each Web App in the solution.