AZ-104 exam dumps

AZ-104 practice question 195 of 289

Microsoft Certified: Azure Administrator Associate. Associate level, Microsoft. Free question with the correct answer and a full explanation.

AZ-104 Question 195

Single answer

You are an Azure Administrator managing a web application hosted in an Azure App Service. Your team wants to test new code in a staging environment before pushing it to production, ensuring that key-value pairs and environment variables differ between the two environments. After testing, they want to promote the staged deployment to production with minimal downtime. Which approach should you take?

  1. A

    Create a new deployment slot, enable Auto Swap, and put staging environment variables directly in the web.config.

  2. B

    Create a staging slot, configure slot settings for environment variables, and use the Swap feature to move the staged app into production.

  3. C

    Configure a new slot and store the environment variables in the appsettings.json file, then manually copy them to production when ready.

  4. D

    Create a new App Service Plan for the staging environment and configure separate variables in the same slot.

Show answer and explanation

Correct answer: B

Explanation

Deployment slots provide an efficient way to separate environments and perform zero-downtime deployments. By creating a staging slot and assigning unique slot settings, changes can be tested thoroughly. When ready, use the Swap feature to promote the code to production with minimal impact to users.

  • A. Incorrect.

    Enabling Auto Swap might immediately push every build on the staging slot into production. Also, environment variables set directly in web.config do not guarantee proper isolation between slots.

  • B. Correct.

    This is the recommended practice. Staging slots allow you to configure distinct slot settings for variables and then perform a controlled Swap for minimal downtime.

  • C. Incorrect.

    While you can store environment variables in appsettings.json, this approach complicates environment isolation and requires manual copying, increasing the risk of errors.

  • D. Incorrect.

    Setting up an additional App Service Plan for staging is typically unnecessary and incurs extra cost. Deployment slots within the same plan are more cost-effective and straightforward.

Timed practice exam

Take a AZ-104 practice test under exam conditions

60 questions in 60 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam