6

I've got a web application in ASP.Net 5 with the source in VS Team Services. Using the Team Services build system, I'd like to deploy it directly to Azure for Continuous Deployment.

I've followed the steps here: https://msdn.microsoft.com/Library/vs/alm/Build/azure/deploy-aspnet5

However, when the website is deployed, only the new files are added and existing ones are overridden. Any deleted files are not removed. This means that extra controllers that were removed during refactoring (for example) still hang around.

Is there a way to force the deployment to wipe out any existing deployed website before putting the new one in place?

I've already run into an issue where the site is unable to deploy due to files being locked. I fixed this by wrapping the publish command in commands to start/stop the site:

Stop-AzureWebsite -Name $websiteName

. $publishScript -publishProperties $publishProperties  -packOutput $packOutput

Start-AzureWebsite -Name $websiteName

In theory I could instead remove and create the website, but that seems a bit heavy handed...

Esther Fan - MSFT
  • 8,276
  • 4
  • 27
  • 25
Alasdair Ross
  • 370
  • 3
  • 9

2 Answers2

6

Another option, using the publish profile:

enter image description here

ZGFubnk
  • 500
  • 4
  • 13
4

Add this to your MSBuild parameters:

/p:SkipExtraFilesOnServer=False

Additional parameters here:

Valid Parameters for MSDeploy via MSBuild

Community
  • 1
  • 1
Bruno Faria
  • 5,219
  • 3
  • 24
  • 27