Skip to content
Latchkey

Azure App Service "Conflict ... operation in progress" on slot deploy in CI

App Service serializes deployments and slot operations on a site. If a prior deploy or swap has not finished, a new one returns 409 Conflict because another operation is in progress.

What this error means

The deploy or az webapp deployment slot swap fails with "Conflict (CODE: 409)" and a message that another operation is in progress on the site or slot.

Azure
Conflict (CODE: 409)
Cannot modify this site because another operation is in progress.
(Code: Conflict)

Common causes

Overlapping deploys to the same site

Two pipeline runs (or a retried job) target the same web app at once, so the second collides with the first still-running operation.

A slot swap is still settling

A deploy fired immediately after a slot swap hits the site while the swap is finishing, returning 409.

How to fix it

Serialize deploys with concurrency control

  1. Add a concurrency group so only one deploy to the app runs at a time.
  2. Let in-flight runs finish before the next starts.
  3. Re-run the deploy.
.github/workflows/ci.yml
concurrency:
  group: deploy-my-app
  cancel-in-progress: false

Wait for the prior operation, then retry

If the conflict is transient, poll the site state until it is ready, then redeploy.

Terminal
az webapp show --name my-app --resource-group rg --query state -o tsv

How to prevent it

  • Use a concurrency group keyed on the app so deploys never overlap.
  • Insert a brief settle/poll after a slot swap before deploying again.
  • Avoid retrying a deploy while the first attempt may still be running.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →