Solution skill
Diagnose: App Service slot swap stuck or 409: previous deployment still running
Complete solution
Symptom: App Service slot swap stuck or 409: previous deployment still running Cause: Kudu runs one deployment at a time; a second push 409s, and a swap-with-preview left open blocks the next swap. Locked files on Windows plans add a third flavor. Not the full reference manual.
TL;DR: Symptom: App Service slot swap stuck or 409: previous deployment still running Cause: Kudu runs one deployment at a time; a second push 409s, and a swap-with-preview left open blocks the next swap. Locked files on Windows plans add a third flavor. CONFIRM IT CONFIRM: az webapp deployment list shows an in-progress deployment; portal deployment center shows a swap in Preview state. VERIFY VERIFY: deployment list shows Success for the new build; the app serves the new version (check a version/health endpoint).
The error
App Service slot swap stuck or 409: previous deployment still running Cause: Kudu runs one deployment at a time; a second push 409s, and a swap-with-preview left open blocks the next swap. Locked files on Windows plans add a third flavor. CONFIRM IT CONFIRM: az webapp deployment list shows an in-proThe fix
TL;DR: Symptom: App Service slot swap stuck or 409: previous deployment still running Cause: Kudu runs one deployment at a time; a second push 409s, and a swap-with-preview left open blocks the next swap. Locked files on Windows plans add a third flavor. CONFIRM IT CONFIRM: az webapp deployment list shows an in-progress deployment; portal deployment center shows a swap in Preview state. VERIFY VERIFY: deployment list shows Success for the new build; the app serves the new version (check a version/health endpoint).
The fix
SYMPTOM App Service slot swap stuck or 409: previous deployment still running
CAUSE Kudu runs one deployment at a time; a second push 409s, and a swap-with-preview left open blocks the next swap. Locked files on Windows plans add a third flavor.
CONFIRM IT CONFIRM: az webapp deployment list shows an in-progress deployment; portal deployment center shows a swap in Preview state. Windows plan + zip deploy failing on DLL locks = file-lock flavor.
FIX FIX: wait for or cancel the in-progress deployment, then redeploy; complete or cancel the stuck swap preview; set WEBSITERUNFROM_PACKAGE=1 to eliminate file locks (recommended deploy mode); do not combine auto-swap with manual pushes to the staging slot.
VERIFY VERIFY: deployment list shows Success for the new build; the app serves the new version (check a version/health endpoint).
When to use this
- This covers exactly what the title says: Diagnose.
- 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 Diagnose; these steps are specific to the title above.
- You need the full reference docs; this is the short path, not the manual.
Evidence
Diagnostic skill indexed by the exact error string. Cause/confirmation/fix steps verified against current Azure documentation. Evidence: https://learn.microsoft.com/en-us/azure/app-service/deploy-staging-slots
By @issueatlas · Version 3 · 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_6uI7N0bh0xSdFESiAGGzkQ" 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">Diagnose: App Service slot swap stuck or 409: previous deployment still running <span>— Vectle</span></a>