question

HealingLegodi-5533 avatar image
0 Votes"
HealingLegodi-5533 asked ajkuma-MSFT commented

App Service Build Service, "running deployment command" takes over an hour to finish

Hi,

My App on Azure has 1 project but takes forever to deploy.

I am using this as my build settings
Build
Build provider:
App Service Build Service
Runtime stack:
.NET
Version:
3.1

According to the logs, the "Running deployment command..." activity takes a while... In the latest incident, it took 01h 17m to complete

Here is part of the output

Time Elapsed 01:17:38.05
Creating app_offline.htm
KuduSync.NET from: 'D:\local\Temp\


azure-webapps-content-deployment
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ajkuma-MSFT avatar image
0 Votes"
ajkuma-MSFT answered ajkuma-MSFT commented

@HealingLegodi-5533,

Are you provisioning the WebApp via Visual Studio and VSTS App Service release tasks?

All other deployment methods in App Service writes to D:\home\site\wwwroot in your app (or /home/site/wwwroot for Linux apps). However, when you run directly from a package, the files in the package are not copied to the wwwroot directory. Instead, the ZIP package itself gets mounted directly as the read-only wwwroot directory.

In your case, the location is pointing to 'D:\local\Temp\ - please review the path.


To isolate the issue: :
• Go to Kudu Console (http://yoursitename.scm.azurewebsites.net/)
• Now manually create App_Offline.htm from Kudu, by running touch App_Offline.htm from d:\home\site\wwwroot
-Review and delete 'app_offline.htm' in D:\local\Temp\ or try restarting your WebApp from portal.

Typically, when deploying .NET apps to Web App on Windows, deployment may fail with error code ERROR_FILE_IN_USE. To resolve the error, ensure Rename locked files and Take App Offline options are enabled in the task. For zero downtime deployments, use slot swap.

TakeAppOfflineFlag (Take App offline) default value is true.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@HealingLegodi-5533, Additionally,

You may try any of these options to further isolate:

**A.**You may instead use “Run From Package” deployment method to avoid resource locking.

See this doc section for more on details on this -

B. On Azure Portal, navigate to your App Service’s application settings, and add the following key-value pair:
MSDEPLOY_RENAME_LOCKED_FILES = 1

C. If the issue persist, you may test by adding an SCM_CREATE_APP_OFFLINE App Setting to the app and set the value to 0.

Stop your app or enable offline mode for it during deployment. For more information, see Deal with locked files during deployment.

Kindly let us know how it goes, I'll follow-up with you further.

0 Votes 0 ·