az-104 Practice Question 1733

Exam: az-104
Domain: Deploy and manage Azure compute resources
Topic: Create and configure containers
Difficulty: medium
Contoso Ltd needs to ensure that their Azure App Service web application remains available during planned maintenance windows. They want to implement a restart policy that minimizes downtime during these periods. Which restart policy should they use, and how should they configure it to meet this requirement?

Answer Options

A
Use the `Always` restart policy
B
Use the `OnFailure` restart policy with a custom script to perform a graceful shutdown before restarting
C
Use the `None` restart policy
D
Use the `Never` restart policy

Correct Answer

B: Use the `OnFailure` restart policy with a custom script to perform a graceful shutdown before restarting

Explanation

The correct answer is B, `Use the `OnFailure` restart policy with a custom script to perform a graceful shutdown before restarting`. This ensures that the application can gracefully shut down during maintenance, reducing downtime. Option A, `Use the `Always` restart policy`, would cause unnecessary restarts, increasing downtime. Option C, `Use the `None` restart policy`, would leave the application in an unstable state if it crashes, leading to potential data loss or service disruptions. Option D, `Use the `Never` restart policy`, is not a valid restart policy in Azure Container Instances (ACI) and would not provide any restart functionality.