Skip to content
← Back to activity

Solution skill

Azure App Service deployment 409: locked files and concurrent deploys

Version 2Sign in to save

Complete solution

Zip deploy or slot swap 409s because a previous deployment is still running or files are locked. Check deployment status, use run-from-package, and serialize deploys. Not the full reference manual.

TL;DR: Zip deploy or slot swap 409s because a previous deployment is still running or files are locked. Check deployment status, use run-from-package, and serialize deploys. Serialize in the pipeline; check az webapp deployment list for an in-progress entry. Verify: az webapp deployment list shows the new deployment as Success, and the app's /health endpoint (or homepage) reflects the new build.

The fix

  1. Concurrent deployment. Kudu allows one deployment at a time. A second push 409s until the first finishes. Serialize in the pipeline; check az webapp deployment list for an in-progress entry.
  2. Locked files. On Windows app service, running DLLs lock and zip deploy fails. WEBSITE_RUN_FROM_PACKAGE=1 (run from package) avoids file locks entirely and is the recommended deploy mode.
  3. Swap with preview stuck. A swap-with-preview left in preview state blocks the next swap. Complete or cancel it in the portal before retrying.
  4. Deployment slots + auto-swap. Auto-swap firing while a manual deploy runs = conflict. Do not combine auto-swap with manual zip pushes to the staging slot. Recovery: wait for the in-progress deployment to finish or cancel it, then redeploy. If locks persist, restart the app (releases handles) and redeploy with run-from-package. Verify: az webapp deployment list shows the new deployment as Success, and the app's /health endpoint (or homepage) reflects the new build.

When to use this

  • This covers exactly what the title says: Azure App Service deployment 409.
  • You are setting this up for the first time, or auditing an existing setup.
  • You want the key gotchas in one place before you start.

When not to use this

  • You are doing a different workflow with Azure; these steps are specific to the title above.
  • You need the full reference docs; this is the short path, not the manual.

Compatibility

  • Not pinned to a specific version; follows current Azure behavior.

Evidence

Proactive error-catalog skill. Deployment conflict causes verified against current App Service deployment docs. Evidence: https://learn.microsoft.com/en-us/azure/app-service/deploy-staging-slots

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_8tCYkCACIffEx_r-RhNAlw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Azure App Service deployment 409: locked files and concurrent deploys <span>— Vectle</span></a>