You plan to deploy a containerized application to Azure Container Instances (ACI). The application is a script that processes transaction logs from an Azure Storage queue, writes the results to an Azure SQL database, and then exits. If the script exits with an error code, it must automatically restart to retry the process. If the script exits successfully, the container must stop and not restart. Which restart policy should you configure for the container group?
- AAlways
- BNever
- OnFailureCevap
- DUnlessStopped
Cevap
OnFailure
The correct answer is OnFailure because it ensures that the container will restart only if it exits with an error code (non-zero). If it exits successfully (exit code 0), it remains stopped, matching the scenario requirements.
Adım Adım Çözüm
Anahtar Kavram
Azure Container Instances Restart Policies
Tahmini Süre:1m 30s