---
source: https://iinventedlight.com/library/notes/azure-app-service-zip-deploy.md
title: "Deploy to Azure App Service with a ZIP package and az webapp deploy"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (Microsoft Learn (Azure docs)); CC-BY-4.0 (MicrosoftDocs/azure-docs (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Microsoft Learn (Azure docs), Deploy files to App Service; MicrosoftDocs/azure-docs (GitHub), deploy-zip.md (source page). CC-BY-4.0 (https://raw.githubusercontent.com/MicrosoftDocs/azure-docs/main/LICENSE). Copyright Microsoft Corporation."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: azure app service zip deploy"
tags: [azure, app-service, deployment, zip-deploy, kudu, cli]
client: Librarian
sources:
  - id: S1
    title: "Deploy files to App Service"
    publisher: Microsoft Learn (Azure docs)
    url: https://learn.microsoft.com/en-us/azure/app-service/deploy-zip
    accessed: 2026-11-18
    license: "CC-BY-4.0"
  - id: S2
    title: "deploy-zip.md (source page)"
    publisher: MicrosoftDocs/azure-docs (GitHub)
    url: https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/app-service/deploy-zip.md
    accessed: 2026-11-18
    license: "CC-BY-4.0"
---
# Deploy to Azure App Service with a ZIP package and az webapp deploy
**Answer:** Create a ZIP package and push it with `az webapp deploy --resource-group <group-name> --name <app-name> --src-path <zip-package-path>`. App Service unpacks the package into `/home/site/wwwroot` on Linux or `D:\home\site\wwwroot` on Windows and restarts the app.

## Commands

```shell
cd my-app
zip -r app.zip .
az webapp deploy --resource-group <group-name> --name <app-name> --src-path app.zip

# Run the build (including package restore) during deployment
az webapp config appsettings set --resource-group <group-name> --name <app-name> \
  --settings SCM_DO_BUILD_DURING_DEPLOYMENT=true

# Other file types
az webapp deploy --resource-group <group-name> --name <app-name> --src-path scripts/startup.sh --type=startup
az webapp deploy --resource-group <group-name> --name <app-name> --src-path driver.jar --type=lib
```

## Packaging rules

- Include only the files and directories in the root directory, not the root directory itself.
- A GitHub repository downloaded as a ZIP file can't be deployed as-is, because GitHub adds nested directories at the top level.

## What Kudu does

ZIP package deployment uses the same Kudu service that powers continuous integration-based deployments. It supports:
- deletion of files left over from a previous deployment
- an optional default build process, which includes package restore
- deployment scripts and deployment logs
- a package size limit of 2,048 megabytes

Files are copied only if their timestamps don't match what's already deployed. The CLI command uses the Kudu publish API; with `--type=startup`, App Service automatically uses your script to start your app.

## Portal option

In Kudu (Development Tools > Advanced Tools), Tools > Zip Push Deploy accepts a dragged ZIP package. This endpoint doesn't work for App Service on Linux.

## See also

- [azure-kubernetes-service](https://iinventedlight.com/library/notes/azure-kubernetes-service/)
- [docker-build-context](https://iinventedlight.com/library/notes/docker-build-context/)

## Claims

- id: C1
  claim: Do not include the root directory in the ZIP package.
  source: S1
  evidence: "don't include the root directory"

- id: C2
  claim: The package size limit is 2,048 megabytes.
  source: S2
  evidence: "A package size limit of 2,048 megabytes"

- id: C3
  claim: Files are copied only if their timestamps differ.
  source: S2
  evidence: "Files in the ZIP package are copied only if their timestamps don't match"

## Sources

- [S1] Deploy files to App Service. Microsoft Learn (Azure docs). https://learn.microsoft.com/en-us/azure/app-service/deploy-zip . License: CC-BY-4.0. Accessed 2026-11-18.

- [S2] deploy-zip.md (source page). MicrosoftDocs/azure-docs (GitHub). https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/app-service/deploy-zip.md . License: CC-BY-4.0. Accessed 2026-11-18.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Microsoft Learn (Azure docs), Deploy files to App Service; MicrosoftDocs/azure-docs (GitHub), deploy-zip.md (source page). CC-BY-4.0 (https://raw.githubusercontent.com/MicrosoftDocs/azure-docs/main/LICENSE). Copyright Microsoft Corporation. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
