question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Remove additional files at destination" tries to remove App_Data\jobs but fails

See original GitHub issue

Hi guys,

We noticed that after enabling “Remove additional files at destination” that some of our releases failed with the following message (as a pre-caution we do take the app service offline to ensure files are not in use however web jobs, particularly Application Insights Profile, may fall outside of this scope).

2017-06-08T22:31:02.0197305Z ##[section]Starting: Deploy the Website
2017-06-08T22:31:02.0207304Z ==============================================================================
2017-06-08T22:31:02.0207304Z Task         : Azure App Service Deploy
2017-06-08T22:31:02.0207304Z Description  : Update Azure App Service using Web Deploy / Kudu REST APIs
2017-06-08T22:31:02.0207304Z Version      : 3.3.6
2017-06-08T22:31:02.0207304Z Author       : Microsoft Corporation
2017-06-08T22:31:02.0207304Z Help         : [More Information](https://aka.ms/azurermwebdeployreadme)
2017-06-08T22:31:02.0207304Z ==============================================================================
2017-06-08T22:31:02.5947349Z fa2c3c8c-144d-4a56-ba15-1c9de91ed6e3 exists true
2017-06-08T22:31:05.8314062Z Got connection details for Azure App Service:'gcvp-dev-aus'
2017-06-08T22:31:18.6024049Z ConnectionString attributes in Web.config is parameterized by default. Note that the transformation has no effect on connectionString attributes as the value is overridden during deployment by 'Parameters.xml or 'SetParameters.xml' files. You can disable the auto-parameterization by setting /p:AutoParameterizationWebConfigConnectionStrings=False during MSBuild package generation.
2017-06-08T22:31:19.7484060Z [command]d:\a\_tasks\AzureRmWebAppDeployment_497d490f-eea7-4f2b-ab94-48d9c1acdcb1\3.3.6\ctt\ctt.exe s:d:\a\r1\a\temp_web_package_6916328397802707\Content\d_C\a\1\s\Gtwm.UI\GetTheWorldMoving\obj\Debug\Package\PackageTmp\Web.config t:d:\a\r1\a\temp_web_package_6916328397802707\Content\d_C\a\1\s\Gtwm.UI\GetTheWorldMoving\obj\Debug\Package\PackageTmp\Web.Development.config d:d:\a\r1\a\temp_web_package_6916328397802707\Content\d_C\a\1\s\Gtwm.UI\GetTheWorldMoving\obj\Debug\Package\PackageTmp\Web.config pw
2017-06-08T22:31:19.9824062Z [command]d:\a\_tasks\AzureRmWebAppDeployment_497d490f-eea7-4f2b-ab94-48d9c1acdcb1\3.3.6\ctt\ctt.exe s:d:\a\r1\a\temp_web_package_6916328397802707\Content\d_C\a\1\s\Gtwm.UI\GetTheWorldMoving\obj\Debug\Package\PackageTmp\bin\Web.config t:d:\a\r1\a\temp_web_package_6916328397802707\Content\d_C\a\1\s\Gtwm.UI\GetTheWorldMoving\obj\Debug\Package\PackageTmp\bin\Web.Development.config d:d:\a\r1\a\temp_web_package_6916328397802707\Content\d_C\a\1\s\Gtwm.UI\GetTheWorldMoving\obj\Debug\Package\PackageTmp\bin\Web.config pw
2017-06-08T22:31:20.1924058Z XML Transformations applied successfully
2017-06-08T22:31:45.1784063Z [command]"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package='d:\a\r1\a\temp_web_package_3243713071943448.zip' -dest:auto,ComputerName='https://gcvp-dev-aus.scm.azurewebsites.net:443/msdeploy.axd?site=gcvp-dev-aus',UserName='********',Password='********',AuthType='Basic' -setParam:name='IIS Web Application Name',value='gcvp-dev-aus' -userAgent:VSTS_ec22fe19-8121-4cb0-b90f-54a3dcbb6beb_release_7_177_351_1
2017-06-08T22:31:45.9494061Z Info: Using ID '58006f4b-864a-44c0-8ec4-df22b0329e87' for connections to the remote server.
2017-06-08T22:31:52.2212691Z Info: Deleting file (gcvp-dev-aus\App_Data\jobs\continuous\ApplicationInsightsProfiler\ApplicationInsightsProfiler.exe).
2017-06-08T22:31:52.2222688Z Info: Deleting file (gcvp-dev-aus\App_Data\jobs\continuous\ApplicationInsightsProfiler\ApplicationInsightsProfiler.exe.config).
2017-06-08T22:31:52.2222688Z Info: Deleting directory (gcvp-dev-aus\App_Data\jobs\continuous\ApplicationInsightsProfiler).
2017-06-08T22:31:52.2222688Z Info: Deleting directory (gcvp-dev-aus\App_Data\jobs\continuous).
2017-06-08T22:31:52.2222688Z Info: Deleting directory (gcvp-dev-aus\App_Data\jobs).
2017-06-08T22:31:52.4342685Z ##[error]Failed to deploy web package to App Service.
2017-06-08T22:31:52.4352691Z ##[error]Error: (6/8/2017 10:31:52 PM) An error occurred when the request was processed on the remote computer.
Error: An error was encountered when processing operation 'Delete Directory' on 'D:\home\site\wwwroot\App_Data\jobs'.
Error: The error code was 0x80070091.
Error: The directory is not empty.

   at Microsoft.Web.Deployment.NativeMethods.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath)
   at Microsoft.Web.Deployment.DirectoryEx.Delete(String path)
   at Microsoft.Web.Deployment.DirPathProviderBase.Delete(Boolean whatIf)
Error count: 1.

2017-06-08T22:31:52.4352691Z ##[error]Error: C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe failed with return code: 4294967295
2017-06-08T22:31:52.9850754Z Successfully updated deployment History at https://gcvp-dev-aus.scm.azurewebsites.net/deployments/1771496961112422
2017-06-08T22:31:53.0370736Z ##[section]Finishing: Deploy the Website

By either manually removing the App_Data\jobs folder in the SCM site or disabling “Remove additional files at destination” we were able to successfully release. But ideally, we’d like to be able to both remove files we deleted in a prior commit and keep our web jobs running.

Is there something I am missing or is this a conflict between the way App Insights deploys the profiling tool and the way the Azure App Service Deploy tasks deletes files?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:22 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
euhmcommented, Jul 24, 2017

I have the same issue, but using the suggested approach 1 is not possible as I deploy through AMR templates (MS Deploy task)

Will the ARM MS Deploy task be updated with this approach?

1reaction
vincent1173commented, Jun 12, 2017

@jamesaarondevlin , can you please try the approach 1 and check if the issue still happening?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Custom Deployment Script - Remove Additional Files At ...
App Service Publish: An error was encountered when processing operation 'Delete files at destination tries to remove AppData\jobs but fails #4496.
Read more >
c# - Add exceptions to web deploy 'remove additional files at ...
I'm trying to publish my web application (ASP.Net Core 2.2 Razor Pages) to my server. I have two folders that are created at...
Read more >
Avoid deleting App_Data folder when publishing? - MSDN
I have set the option to "Remove additional files at destination", but want to keep the App_Data folder and all its content intact, ......
Read more >
Why I can't disable"Remove additional files in destination ...
If you wish to remove files from the source, but keep it on the destination, you may check if the job policy “Remove...
Read more >
Azure Service Principal with Contributor access to Azure Linux ...
Remove Additional Files : Files in the destination that are not part of the ... This needs access to create Resource Groups, App...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found