Deployment Failed. deployer = GITHUB_ZIP_DEPLOY deploymentPath = ZipDeploy. Extract zip. Remote build. Error: Failed to deploy web package to App Service. Error: Deployment Failed, Package deployment using ZIP Deploy failed. Refer logs for more details.

I am using GitHub cli to deploy my Django app to Azure app service It was working fine until GitHub started to use zip deployment or package deployment then It gives me this error.

I tried to add WEBSITE_RUN_FROM_PACKAGE=1in my app configurations and the deployments pass in GitHub without errors but the app doesn't work at all.

1

There are 1 answers

5
Pravallika KV On
  • Check the logs in Azure App Service=>Deployment Center=>Logs to know error in detail.
  • Try adding settings SCM_DO_BUILD_DURING_DEPLOYMENT=1 and ENABLE_ORYX_BUILD=1 in App Service=>Configuration=>New Application Settings(in old Azure portal) (or) App Service=>Environmental variables.
  • If still the issue persists, try deploying with other method like GitHub Actions.

I deployed a simple Django web app to Azure App Service using GitHub Actions.

Steps followed:

  • Configure Deployment during the creation of App Service in Azure portal by Enabling continuous deployment and select the GitHub repository and branch of your Django project.

enter image description here

  • It creates workflow to deploy the project to Azure automatically in GitHub, the deployment status can be tracked in your repository=>Actions.

My Workflow (.yml):

name: Build and deploy Python app to Azure Web App - <web_app_name>

on:
  push:
    branches:
      - main
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Set up Python version
        uses: actions/setup-python@v1
        with:
          python-version: '3.10'

      - name: Create and start virtual environment
        run: |
          python -m venv venv
          source venv/bin/activate
      
      - name: Install dependencies
        run: pip install -r requirements.txt
        
      # Optional: Add step to run tests here (PyTest, Django test suites, etc.)
      
      - name: Upload artifact for deployment jobs
        uses: actions/upload-artifact@v2
        with:
          name: python-app
          path: |
            . 
            !venv/
  deploy:
    runs-on: ubuntu-latest
    needs: build
    environment:
      name: 'Production'
      url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

    steps:
      - name: Download artifact from build job
        uses: actions/download-artifact@v2
        with:
          name: python-app
          path: .
          
      - name: 'Deploy to Azure Web App'
        uses: azure/webapps-deploy@v2
        id: deploy-to-webapp
        with:
          app-name: '<web_app_name>'
          slot-name: 'Production'
          publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_87XXXXXX }}

Deployed Successfully:

enter image description here

Response:

enter image description here