Search code examples
iisdeploymentcontinuous-integrationazure-devopscd

Visual Studio TFS doesn't deploy web project


I am using Visual Studio team services (visual studio online). I have a visual studio solution with 12 projects including a Web project (front end), which I set up. I had setup a build and deploy pipeline and successfully deployed the project to IIS but on checking the deployed files I found that the Web project wasn't deployed, just the class libraries. Navigating to the website url gives and "unauthorised response".


Solution

  • Refer to these steps to deploy web app:

    1. NuGet Restore task to restore packages
    2. Visual Studio Build task (Solution: ***.sln; MSBuild Arguments: /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageLocation="$(build.artifactstagingdirectory)\"); Platform:xxx(e.g. $Buildplatform); Configuration: XXX(e.g. $(BuildConfiguration))
    3. WinRM-IIS Web App Deployment task: (Machines:XXX; Admin Login: XXX; Password: XXX; Web Deploy Package: $(build.artifactstagingdirectory)\XXX.zip; Website Name: XXX