Azure Container Registry and Container Instances · AZ-204: Developing Solutions for Microsoft Azure Develop Azure Compute Solutions
A batch workload runs in Azure Container Instances and should stop after completing successfully. If it fails, Azure should restart the container aut…
Practice question from Azure Container Registry and Container Instances (AZ-204: Developing Solutions for Microsoft Azure Develop Azure Compute Solutions), with the correct answer and a step-by-step solution.
easy · MCQ · Q-2F075C
A batch workload runs in Azure Container Instances and should stop after completing successfully. If it fails, Azure should restart the container automatically. Which Azure CLI option provides this behavior?
- A.az container create --resource-group rg1 --name batch1 --image contoso/batch:1.0 --restart-policy Always
- B.az container create --resource-group rg1 --name batch1 --image contoso/batch:1.0 --restart-policy OnFailureCorrect answer
- C.az container create --resource-group rg1 --name batch1 --image contoso/batch:1.0 --restart-policy Never
- D.az container create --resource-group rg1 --name batch1 --image contoso/batch:1.0 --restart-policy Manual
Solution
The OnFailure restart policy restarts the container when its process exits with a failure, but does not restart it after a successful completion. Always is intended for continuously running workloads, while Never disables automatic restarts.
More from Azure Container Registry and Container Instances
- A development team has a Dockerfile and wants Azure Container Registry to build the image without requiring Docker to be installed on the d…
- An Azure Container Instance must pull a private image from Azure Container Registry. The security team prohibits storing registry administr…
- A production team deploys an image from Azure Container Registry to Azure Container Instances. The team must ensure that a restart or a lat…
- A company deploys Azure Container Instances in West Europe and East US. The containers in each region frequently pull images from Azure Con…
Practise more Develop Azure Compute Solutions
Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.
Start practising freeFree to start · No credit card needed