Azure Administrator AZ-104 · Deploy and Manage Azure Compute Resources · hard

A web team uses Azure App Service (Standard S1 plan) with a production slot and a staging deployment slot. The staging slot uses a test database connection string (DB_CONN = Server=staging-sql...), while production uses the live database (DB_CONN = Server=prod-sql...). When the team performs a slot swap from staging to production, they must ensure production keeps its live DB_CONN value rather than receiving the staging-sql string. What should they configure?

Published · Last updated · checked before publication — how we verify questions

Options

  • AScale the App Service Plan down to the Free (F1) tier before swapping
  • BDelete the DB_CONN setting before each swap and re-enter it manually
  • CMark the DB_CONN connection string as a Deployment slot settingCorrect answer
  • DStop both the production and staging web apps prior to swapping

Answer: C. Mark the DB_CONN connection string as a Deployment slot setting

When you swap deployment slots in Azure App Service, the content and most configuration move together, so by default the staging slot's app settings and connection strings travel to production with the code. To stop a value from moving, you mark it as a Deployment slot setting, often called a sticky or slot-specific setting. A sticky setting stays attached to the slot where it was defined, so production keeps its live DB_CONN pointing at prod-sql, and staging keeps the test server string, no matter how many swaps occur. You configure it in the web app's Environment variables or Configuration blade by selecting the deployment slot setting checkbox for that entry in each slot. The common trap is assuming the swap only moves code, or that you must manually edit values around each release. Slot settings are the built-in, zero-downtime, repeatable mechanism, and they require a plan tier that supports slots, such as Standard S1.

Why the other options are wrong

  • A. Scale the App Service Plan down to the Free (F1) tier before swapping — Free (F1) is a plan tier that does not support deployment slots at all, since slots need Standard, Premium, or Isolated. Scaling down would remove the slots rather than control which settings swap.
  • B. Delete the DB_CONN setting before each swap and re-enter it manually — Deleting and re-entering the setting by hand is a fragile, error-prone manual process that risks leaving production without a valid connection string and causing downtime or outages. It is not the built-in mechanism for keeping a value slot-specific.
  • D. Stop both the production and staging web apps prior to swapping — Stopping the apps only causes an outage and defeats the warm-up and zero-downtime purpose of a swap. Running state has no effect on whether a setting is sticky, so the connection string would still swap.

All Deploy and Manage Azure Compute Resources questions and the topic overview →

Microsoft and Azure are trademarks of Microsoft Corporation. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Microsoft Corporation.