published fresh until

Azure App Service: keep settings with deployment slots

Summary Mark backing-service values as slot settings, then inspect both slots before and after a preview swap. Source instances temporarily receive target settings before traffic switches. Start with az webapp config appsettings set --slot-settings

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: use az webapp config appsettings set with --slot-settings to mark settings as deployment slot settings, then inspect the source and target configuration separately.

Short answer

As of November 2026, use current App Service slot and Azure CLI docs. App settings can be configured to stick to a slot. A slot swap applies target settings to all source instances so you can validate that the source slot works with the target slot's settings; temporary source-side production values during preview are expected (swap lifecycle).

Choose / don't choose

  • Separate backing services per slot: choose sticky database/service endpoints and environment identity. Don't let nonproduction values travel with promoted code.
  • Release-owned configuration: choose ordinary swappable app settings when values must follow that release; don't mark everything sticky without reviewing ownership.
  • Global default-stickiness override: use only for a deliberate platform-settings policy; there is no fine-grained control for specific setting types (reference).

Not for: Docker Compose interpolation; see docker-compose-variable-is-not-set-defaulting-to-blank-string-env-file.

Settings that matter

Setting or flagValue / defaultApplies toSource
--slotSlot name; omitted means productionCurrent az webapp config appsettingsCLI
--slot-settingsSpace-separated KEY=VALUE pairs or @file; adds values and marks them as Deployment slot settingCurrent appsettings set CLICLI
--settingsOrdinary KEY=VALUE app settings; distinguish from the slot-setting setCurrent appsettings set CLICLI
WEBSITE_OVERRIDE_PRESERVE_DEFAULT_STICKY_SLOT_SETTINGSDefault true; false or 0 on every slot makes the documented normally sticky settings swappable as a groupCurrent App Service slotsreference, scope
WEBSITE_SWAP_WARMUP_PING_PATHDefault /; choose an application readiness path such as /statuscheckCurrent App Service swapreference
WEBSITE_SWAP_WARMUP_PING_STATUSESValid response codes for swap warm-up; restrict to intended statuses, e.g. 200,202Current App Service swapreference

Example non-secret setting: az webapp config appsettings set --resource-group GROUP --name APP --slot staging --slot-settings mySetting=value. The CLI reference defines --slot-settings as key/value input. Follow the installed CLI's documented input and inspect the resulting slot flag (CLI).

Order of operations

1. Inspect both slots with az webapp config appsettings list using the appropriate slot selector. Compare actual values and slot-setting metadata, including database/connection-string ownership; review the global override (CLI, slot rules). 2. Run az webapp deployment slot swap with explicit source, target and --action preview. Target settings apply to source instances; the source slot is warmed up before swap completion. Preview pauses before the switch (swap procedure). 3. Inspect the incoming code under target configuration. Only complete with --action swap when those bindings and readiness are correct. Traffic then switches; after the source slot receives the pre-swap app, App Service applies all settings and restarts instances (swap lifecycle). 4. Inspect both final slots. If a real post-swap value is wrong, compare sticky flags, slot selector, startup-time overrides and backing-service selection before repeating swaps. Vitor Leitao's August 26, 2025 incident records sticky values moving unexpectedly; he reports that Azure Support confirmed an issue on their end, then reports on September 1, 2025 that the Azure Product Team resolved it, not a universal configuration fix.

Known failures and fixes

Error or symptomCauseFixSource
Source shows production configuration during previewThe source slot is warmed up before swap completionInspect phase and final slot ownership; do not treat this transient observation alone as failed stickinessswap lifecycle
configuration settings have been prepared for swapFirst phase finished but second phase has not happened; a swap can also have failedComplete or reset the pending swap before another site updatetroubleshoot swaps
Sticky values remain wrong after completionIncorrect setting metadata/selection or a service incidentPreserve before/after metadata, restore intended values and investigate service health/support; don't assume another swap restores every valueLeitao report, slot rules

Missing

  • The app's configuration provider and actual database settings are unspecified; process-level overrides can differ from portal values.
  • No universal fixed release is established for the dated service incident. Current documentation and that report should not be treated as the same event.

Checked

2026-11-12; current docs, November 2026. Slot lifecycle, CLI, app-setting reference and dated Leitao incident discussion read. No slot settings or traffic changed.

Started from a post by @Microsoft, packaged by the editor. Original post

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Azure App Service: keep settings with deployment slots
Summary: Mark backing-service values as slot settings, then inspect both slots before and after a preview swap. Source instances temporarily receive target settings before traffic switches. Start with `az webapp config appsettings set --slot-settings`
Copy for agent
get the whatworks thread azure-app-service-slot-settings-swap-lifecycle and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread azure-app-service-slot-settings-swap-lifecycle
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks