0
votes

In Visual Studio Online I have a scripted build that builds Orchard 1.9.1 from source then, using the Azure Web App Deployment task, deploys the compiled Web Deploy Package to Azure.

The first deployment to a fresh Web App instance works great and the system functions as expected. However, any subsequent deployment to the same Web App fails with:

Unable to perform the operation ("Delete File") for the specified directory ("HtmlAgilityPack.dll"). This can occur if the server administrator has not authorized this operation for the user credentials you are using. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_INSUFFICIENT_ACCESS_TO_SITE_FOLDER.

The file specified in the error can be different, but the deployment fails consistently. The link in the error isn't of much help as the implementation details covered (IIS, root folder etc) are abstracted away in an Azure Web App.

Where should I look to fix this permissioning issue?

I went with the default build template for Azure Website when creating the build, details of which are below for info:

Build Step: enter image description here

MSBuild Arguments:

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true 
/p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.stagingDirectory)"

Azure Web App Deployment step: enter image description here


Pertinent information for the build log:

2015-09-28T05:36:22.7928424Z Package= C:\a\d8c9303e\staging\Orchard.Web.zip     
2015-09-28T05:36:22.7938416Z Slot=      
2015-09-28T05:36:22.7938416Z AdditionalArguments=      
2015-09-28T05:36:22.8028415Z packageFile= Find-Files -SearchPattern C:\a\d8c9303e\staging\Orchard.Web.zip     
2015-09-28T05:36:22.8198428Z packageFile= C:\a\d8c9303e\staging\Orchard.Web.zip     
2015-09-28T05:36:22.8258420Z Get-AzureWebSite -Name **** -ErrorAction SilentlyContinue     
2015-09-28T05:36:28.4361621Z Publish-AzureWebsiteProject -Name "****" -Package "C:\a\d8c9303e\staging\Orchard.Web.zip"     
2015-09-28T05:36:33.8798112Z ##[error]Unable to perform the operation ("Delete File")  for the specified directory ("HtmlAgilityPack.dll"). This can occur if the server administrator has not authorized this operation for the user credentials you are using.     
2015-09-28T05:36:33.8818107Z ##[error]  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_INSUFFICIENT_ACCESS_TO_SITE_FOLDER.
1
Can you use the specific Orchard.proj msbuild script and specify the Precompiled target instead?Sébastien Ros - MSFT
Thanks @SébastienRos-MSFT, looking into that now. Could you elaborate on what that should change in terms of the deployment step?Pero P.
Maybe it won't try to update this dll as it should only be in App_data/dependencies and Precompiled would never create this file, it's copied at runtime.Sébastien Ros - MSFT
Great, that seems to have worked. Thank- you! If you want to post the answer I can accept it. One thing is I'd like to retain app_data, as now the deployment has worked I'm back at the initial set up screen. What would be the best way of doing this with a Azure Web App deployment?Pero P.
I don't know how to make the deployment not delete a specific folder but just update the existing ones. I know that Kudu supports this in a very clever way. Have you tried using it? It would connect to your git repos, update it, build and deploy all from Azure directly.Sébastien Ros - MSFT

1 Answers

1
votes

Use the provided Orchard.proj msbuild script using the Precompiled target.