webapps-deploy: ZIP Deploy failed

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

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 31 (8 by maintainers)

Most upvoted comments

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.

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.

Closing this issue as its already fixed. Let us know if you are still facing issue, we will reopen this issue.

Seems that it is still happening…