azure-devopsazure-pipelinesms-release-managementazure-pipelines-release-pipeline

VSTS deployment to multiple app services


I am using VSTS with TFS repository for hosting my code. The solution is a Asp.Net core solution and contains couple of projects. I have two projects in the solution that goes to different App Services - one will be deployed to a Web App and other to an API App.

Question is how do I configure a single build definition / release definition that deploys these artifacts. Currently, I have two definitions - one for each and I would like to have one. How can I go about configuring this?


Solution

    1. You can create publish profile (right click a project => Publish) with the same name for these projects (relative path for package location, such as <DesktopBuildPackageLocation>..\..\a\WebApp</DesktopBuildPackageLocation>). With this way, the web app published result will be in different folders.
    2. Specify MSBuild Arguments of Visual Studio Build task will be like this: /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:PublishProfile="[profile name]".
    3. Add Publish Build Artifacts to publish these web app published result (e.g. Path to Publish:$(build.artifactstagingdirectory))
    4. Create a new release definition
    5. Add two Deploy app tasks (e.g. Azure app service deploy)
    6. Specify corresponding package to deploy

    Update:

    Using multiple Publish Tasks to publish each package is ok too (Do not need the publish profile).