When I publish an ASP.NET 4.6 website to an Azure Web App from Visual Studio, I can specify the following parameters in the publish profile (.pubxml file):
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<MSDeployUseChecksum>True</MSDeployUseChecksum>
<EnableMSDeployAppOffline>true</EnableMSDeployAppOffline>
I am now trying to set up a CI build to publish to the same Azure Web App using TFS Build 2015. I have the build publishing successfully, but I cannot find any way to specify the above parameters. In particular, I really need EnableMSDeployAppOffline to be true as otherwise the publish occasionally fails because files are locked.
Internally, the TFS build creates a package using msbuild with the parameters:
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.stagingDirectory)"
And then runs the cmdlet "Publish-AzureWebsiteProject":
Publish-AzureWebsiteProject -Name "name" -Package "package.zip" -Slot "slot"
Is there any way to specify the same parameters using msbuild or Publish-AzureWebsiteProject? This question shows how to set these parameters for ASP.NET 5, but I need a solution for ASP.NET 4.6.