Question
We are currently deploying our MVC application using Visual Studio Team Services (VSTS) to an Azure Web App and are facing issues with skip rules. We wanted to skip a folder during deployment Content/Uploads
using a web deploy skip rule. However, it seems like VSTS is not executing that rule at all. The rules is packaged within the deploy.cmd
file based on the following project configuration.
<PropertyGroup>
<OnBeforePackageUsingManifest>AddCustomSkipRules</OnBeforePackageUsingManifest>
</PropertyGroup>
<Target Name="AddCustomSkipRules">
<ItemGroup>
<MsDeploySkipRules Include="SkipDeleteAppData">
<SkipAction>Delete</SkipAction>
<ObjectName>dirPath</ObjectName>
<AbsolutePath>\\Content\\Uploads</AbsolutePath>
<XPath></XPath>
</MsDeploySkipRules>
</ItemGroup>
</Target>
This configuration add the following rule
-skip:skipaction='Delete',objectname='dirPath',absolutepath='\\Content\\Uploads'
Also, if I take this rule and copy it directly into the "Additional Argument" property of the VSTS aszure web app deployment step, it works like a charm.
I was wondering if I was missing something. I tried looking for other thread or example, without success. I've also try to change the OnBeforePackageUsingManifest
for AfterAddIisSettingAndFileContentsToSourceManifest
as mentionned in comments from Make MSDeploy (Visual Studio) not delete App_Data folder but delete everything else without success.
Thanks,
Update
As of now, my guess is that the "Azure App Service Deploy" task from VSTS is not using the generated cmd
file. It generates the command using the input parameter. Therefore I would need to add the skip rule manually within my deploy tasks instead of the project config.