Azure Devops: Pipeline fails to deploy to Linux Web App

Youssef CHTOUROU 11 Reputation points
2021-07-12T07:17:01.067+00:00

I have a pipeline deploying to my Azure web app, that most of the times errors out because it couldn't deploy to my web app. The task take around 25 mins :

Copying file: 'frontend/.gitignore'  
Copying file: 'frontend/README.md'  
Copying file: 'frontend/package.json'  
Copying file: 'frontend/tsconfig.json'  
Copying file: 'frontend/yarn.lock'  
Omitting next output lines...  
An unknown error has occurred. Check the diagnostic log for details.  
Failed to deploy web package to App Service.  
##[error]Failed to deploy web package to App Service.  
####[error]Error: Package deployment using ZIP Deploy failed. Refer logs for more details.  
##[error]Error: Package deployment using ZIP Deploy failed. Refer logs for more details.  

This task fails only in specific slot in myweb app , authors slots and production slot works fine and the job take around 6 mins

Any ideas what could be wrong?

This the configuration of job :

113851-v-v-v-v-v.png

when enable system.debug=true

[GET]https://XXXXXXXXXXXXXXXXXXXXXXXXXXXXscm.azurewebsites.net:443/api/deployments/latest?deployer=VSTS_ZIP_DEPLOY&time=2021-07-12_10-05-37Z
POLL URL RESULT: {"statusCode":202,"statusMessage":"Accepted","headers":{"transfer-encoding":"chunked","content-type":"application/json; charset=utf-8","location":"http://XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXscm.azurewebsites.net:80/api/deployments/latest?deployer=VSTS_ZIP_DEPLOY&time=2021-07-12_10-05-37Z","server":"Kestrel","date":"Mon, 12 Jul 2021 10:14:09 GMT","connection":"close"},"body":{"id":"ad8c2517191a47cb9a73c95a8ec3a85a","status":0,"status_text":"Building and Deploying 'ad8c2517191a47cb9a73c95a8ec3a85a'.","author_email":"N/A","author":"N/A","deployer":"VSTS_ZIP_DEPLOY","message":"Created via a push deployment","progress":"Running deployment command...","received_time":"2021-07-12T10:05:45.7023392Z","start_time":"2021-07-12T10:05:47.0935168Z","end_time":null,"last_success_end_time":null,"complete":false,"active":false,"is_temp":false,"is_readonly":true,"url":null,"log_url":null,"site_name":"XXXXXXXXXXXXXXXXXXXXXXXX"}}
Deployment status: 0 'Building and Deploying 'ad8c2517191a47cb9a73c95a8ec3a85a'.'. retry after 5 seconds

this output appears many time , after 25 mins , the job failed ( with the same output)

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,933 questions
{count} votes

2 answers

Sort by: Most helpful
  1. BhargaviAnnadevara-MSFT 5,456 Reputation points
    2021-07-14T18:34:23.347+00:00

    @Youssef CHTOUROU I tried to setup a Linux App Service on Standard S1 pricing tier enabling 5 (max) slots with CI/CD configured via Azure Pipelines. Unfortunately, I wasn't able to reproduce the same error as yours despite multiple different trials.

    I'd request you to please try the following:

    • Kudu Sync failed in the deployment log resembles this open issue from about a year ago: ZipDelpoy on azure web app linux fails during kudu sync #2972.
      Please check the trace/deployment log files on kudu at https://<appname>.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace or /deployment or from Kudu's DebugConsole (/LogFiles/kudu/*) and check if this is caused by deployment lock failures. In that case, check this wiki out for dealing with locked files during deployment.
    • Try a different deployment method like run from package (to avoid resource locking), using FTP/S, or local git deployment.
      This should help us narrow down the issue further, whether it is caused in the App service/deployment method, or the ADO pipeline/task.
    • Scale up to the next higher tier and re-trigger your pipeline. If it succeeds, scale back down to the original tier.
      This would indirectly restart your SCM sites as well.

    If the above workarounds don't help, you could check on the following:

    • Customize your deploy task with options like TakeAppOfflineFlag, DeploymentType or RenameFilesFlag to streamline your deployment.
    • Try restarting the app/slot just before the deployment in order to recycle the app pool.
    • Check if your app is running into any of the prescribed limits (ex: file system storage) for your tier.
    • Drill down into available metrics for your app to identify any CPU/Memory anomalies.
    • Try the Diagnose and solve problems tool for any additional insights about your app.
    • If your environment permits, try setting up and deploying to a new slot within your App Service, or try verifying if this happens to another app in a different region.

    Hope this helps. Do let us know if the issue persists.

    ----------

    If an answer is helpful, please "Accept answer" and/or "Up-Vote" which might help other community members reading this thread.

    1 person found this answer helpful.
    0 comments No comments

  2. Anjali 5 Reputation points
    2023-09-06T12:39:54.3633333+00:00

    I am deploying next js application to my app service. It was working fine but all of a sudden I am getting error as Kudu sync is failed. An error occurred during web site deployment. Can someone please check and help?IMG_20230906_180703