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.

ZIP Deploy failed

See original GitHub issue

I’ve enabled GitHub Actions for my Azure App Service Dev Slot, but it fails on the deployment step using the webapps-deploy action.

##[error]Failed to deploy web package to App Service.
##[error]Deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details.

Workflow


name: Build and deploy XXXXXX - XXXXXX-web(dev)

env:
  AZURE_WEBAPP_NAME: XXXXXX-web
  AZURE_WEBAPP_PATH: '.'
  AZURE_WEBAPP_SLOT: 'dev'
  DOTNET_VERSION: '3.1.102'
  GITHUB_BRANCH: 'dev'

on:
  push:
    branches:
      - dev

jobs:
  build-and-deploy:
    runs-on: windows-latest

    steps:
    - uses: actions/checkout@master

    - name: Set up .NET Core
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: ${{ env.DOTNET_VERSION }}

    - name: Build XXXXXX project
      run: dotnet build .\XXXXXX\XXXXXX.csproj --configuration Release

    - name: Publish XXXXXX project
      run: dotnet publish .\XXXXXX\XXXXXX.csproj -c Release -o ${{ env.DOTNET_ROOT }}/myapp

    - name: Deploy to Azure Web App
      uses: azure/webapps-deploy@v2
      with:
        app-name: 'XXXXXX-web'
        slot-name: 'Dev'
        publish-profile: ${{ secrets.AzureAppService_PublishProfile_YYYYYYYYYYYYYYYYYYYYYY }}
        package: ${{env.DOTNET_ROOT}}/myapp 

Output

   package: C:\hostedtoolcache\windows\dncs\3.1.102\x64/myapp
  env:
    AZURE_WEBAPP_NAME: XXXXXX-web
    AZURE_WEBAPP_PATH: .
    AZURE_WEBAPP_SLOT: dev
    DOTNET_VERSION: 3.1.102
    GITHUB_BRANCH: dev
    DOTNET_ROOT: C:\hostedtoolcache\windows\dncs\3.1.102\x64
Package deployment using ZIP Deploy initiated.
Updating submodules.
Preparing deployment for commit id '2a48ddc76b'.
Generating deployment script.
Using cached version of deployment script (command: 'azure -y --no-dot-deployment -r "D:\local\Temp\zipdeploy\extracted" -o "D:\home\site\deployments\tools" --basic --sitePath "D:\local\Temp\zipdeploy\extracted\XXXXXX.com"').
Running deployment command...
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling Basic Web Site deployment.
Creating app_offline.htm
Error: Could not find a part of the path 'D:\local\Temp\zipdeploy\extracted\XXXXXX.com'.
KuduSync.NET from: 'D:\local\Temp\zipdeploy\extracted\XXXXXX.com' to: 'D:\home\site\wwwroot'
Failed exitCode=1, command="kudusync" -v 50  -f "D:\local\Temp\zipdeploy\extracted\XXXXXX.com" -t "D:\home\site\wwwroot" -n "D:\home\site\deployments\2a48ddc76bbd4b4c87cb0834cd179a08\manifest" -p "D:\Program Files (x86)\SiteExtensions\Kudu\87.20522.4610\bin\Scripts\firstDeploymentManifest" -i ".git;.hg;.deployment;deploy.cmd"
An error has occurred during web site deployment.
Error: Could not find a part of the path 'D:\local\Temp\zipdeploy\extracted\XXXXXX.com'.\r\nD:\Program Files (x86)\SiteExtensions\Kudu\87.20522.4610\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"
##[error]Failed to deploy web package to App Service.
##[error]Deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
Successfully updated deployment History at https://XXXXXX-web-dev.scm.azurewebsites.net/api/deployments/517bd24fdfb7cee6da766301e1a72a83b52d221e1593760589047
App Service Application URL: http://XXXXXX-web-dev.azurewebsites.net

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:25 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
MrThePlaguecommented, Jul 17, 2020

This also seems to be affecting Linux Web Apps.

Kudu Sync failed
\n/opt/Kudu/Scripts/starter.sh "/home/site/deployments/tools/deploy.sh"
##[error]Failed to deploy web package to App Service.
##[error]Deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
2reactions
wmmihaacommented, Jun 13, 2022

If anyone is still getting this error, here is the solution and a desctiption of what likely caused the problem.

Before GitHub actions were a thing, we used Kudo directly from the Deployment Center of the App Service. However, becase our solution had multiple projects, we had to set a PROJECT configuration variable so Kudo would understand which project to deploy.

Since then, we have copied our app service configuration every time we set up a new site, including the PROJECT configuration variable. This variable is not required when using GitHub Actions, but is still used in Kudo, which is still the underlying framework for deploying your app when using azure/webapps-deploy@v2.

With the PROJECT configuration variable set, Kudo will add it as a parameter as visible in the log:

Using the following command to generate deployment script: 'azure site deploymentscript -y --no-dot-deployment -r "C:\local\Temp\zipdeploy\extracted" -o "C:\home\site\deployments\tools" --basic --sitePath "C:\local\Temp\zipdeploy\extracted\YOUR-PROJECT-VARIABLE"'.

In conclusion, just remove the PROJECT configuration variable from your App Service Configuration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Package deployment using ZIP Deploy failed. Refer logs for ...
In App service -->go to the "Deployment Center" blade, and click on the "Disconnect" button on top. After that re-run the release pipeline....
Read more >
Error: Package deployment using ZIP Deploy failed. Refer ...
Strangly there is no problem when I deploy the same release pipeline to production with this option "Deploy to Slot or App Service ......
Read more >
Error: Package deployment using ZIP Deploy failed
Hi all, I'm unable to deploy my Azure WebApp through Azure DevOps Pipelines because of an error at the latest stage of 'Deploy...
Read more >
Fixing an Azure web app zip deployment issue - Blimped
The builds and deployments ran fine, until they started failing recently with the following error: ERROR: Zip deployment failed.
Read more >
Deployment Issue to Azure app service - Zip deployment failed
During deployment, I got this error : INFO: Starting deployment to Azure app service... az webapp deployment source config-zip --resource-group ...
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