- A
The container is configured with an Azure Files volume that is not accessible.
Why wrong: Inaccessible volume may cause crash, same as B.
- B
The application inside the container exits with a non-zero exit code on startup.
Non-zero exit triggers restart; if immediate, leads to loop.
- C
The container is trying to bind to a port that is already in use on the host.
Why wrong: Port conflict prevents start but not restart loop.
- D
The container is exceeding the allocated CPU or memory limits.
Why wrong: Exceeding limits causes termination, not continuous restart loop.
Quick Answer
The answer is a non-zero exit code on startup, which causes the container to restart continuously even when no crash occurs. This happens because the 'Always' restart policy in Azure Container Instances treats any non-zero exit code as a failure, triggering an immediate restart. If the application exits with a non-zero code right after launching, it creates an infinite restart loop, as the container never reaches a stable running state. On the AZ-204 exam, this scenario tests your understanding of how restart policies interact with application exit codes, a common trap where candidates confuse "Always" with "OnFailure"—the latter only restarts on non-zero codes, while "Always" restarts regardless but still respects exit codes as failure signals. A useful memory tip: think of the exit code as a "health handshake"—if the app waves a red flag (non-zero) at startup, the container keeps trying to shake hands forever.
AZ-204 Develop Azure compute solutions Practice Question
This AZ-204 practice question tests your understanding of develop azure compute solutions. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
You are deploying a containerized application to Azure Container Instances. The application must restart automatically if it crashes. You set the restart policy to 'Always'. However, the container keeps restarting continuously even when there is no crash. What is the most likely cause?
Clue words in this question
Noticing these words before you look at the options changes how you read each choice.
Clue:
"most likely"Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
Clue:
"always"Why it matters: Absolute qualifier. An answer using 'always' is only correct if there are genuinely no exceptions — absolute statements are often wrong in networking.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
The application inside the container exits with a non-zero exit code on startup.
Option B is correct because if the application exits with a non-zero exit code, the 'Always' restart policy treats it as a failure and restarts it. This can lead to a continuous restart loop if the application fails immediately on startup. Option A is wrong because CPU/memory limits don't cause restart loops unless the container is repeatedly terminated (OOMKilled), but that would show a crash. Option C is wrong because volumes causing crashes would exit with non-zero, same as B. Option D is wrong because public IP assignment doesn't affect restart behavior.
Key principle: NAT direction and interface roles matter as much as the IP address mapping. Inside/outside designation controls which traffic is translated.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The container is configured with an Azure Files volume that is not accessible.
Why it's wrong here
Inaccessible volume may cause crash, same as B.
- ✓
The application inside the container exits with a non-zero exit code on startup.
Why this is correct
Non-zero exit triggers restart; if immediate, leads to loop.
Clue confirmation
The clue words "most likely", "always" in the question point toward this answer.
Related concept
Static NAT maps one inside address to one outside address.
- ✗
The container is trying to bind to a port that is already in use on the host.
Why it's wrong here
Port conflict prevents start but not restart loop.
- ✗
The container is exceeding the allocated CPU or memory limits.
Why it's wrong here
Exceeding limits causes termination, not continuous restart loop.
Common exam traps
Common exam trap: NAT rules depend on direction and matching traffic
NAT is not only about the public address. The inside/outside interface roles and the ACL or rule that matches traffic are just as important.
Detailed technical explanation
How to think about this question
NAT questions usually test address translation, overload/PAT behaviour, static mappings and whether the right traffic is being translated. Read the interface direction and address terms carefully.
KKey Concepts to Remember
- Static NAT maps one inside address to one outside address.
- PAT allows many inside hosts to share one public address using ports.
- Inside local and inside global describe the private and translated addresses.
- NAT ACLs identify traffic for translation, not always security filtering.
TExam Day Tips
- Identify inside and outside interfaces first.
- Check whether the scenario needs static NAT, dynamic NAT or PAT.
- Do not confuse NAT matching ACLs with normal packet-filtering intent.
Key takeaway
NAT direction and interface roles matter as much as the IP address mapping. Inside/outside designation controls which traffic is translated.
Real-world example
How this comes up in practice
A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.
What to study next
Got this wrong? Here's your next step.
Review the four NAT address types (inside local, inside global, outside local, outside global), PAT port overload, and static vs dynamic NAT use cases. Then practise related AZ-204 NAT questions on configuration and troubleshooting.
- →
Develop Azure compute solutions — study guide chapter
Learn the concepts, then practise the questions
- →
Develop Azure compute solutions practice questions
Targeted practice on this topic area only
- →
All AZ-204 questions
997 questions across all exam domains
- →
Microsoft Azure Developer Associate AZ-204 study guide
Full concept coverage aligned to exam objectives
- →
AZ-204 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related AZ-204 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Develop Azure compute solutions practice questions
Practise AZ-204 questions linked to Develop Azure compute solutions.
Develop for Azure storage practice questions
Practise AZ-204 questions linked to Develop for Azure storage.
Implement Azure security practice questions
Practise AZ-204 questions linked to Implement Azure security.
Connect to and consume Azure services and third-party services practice questions
Practise AZ-204 questions linked to Connect to and consume Azure services and third-party services.
Monitor, troubleshoot, and optimize Azure solutions practice questions
Practise AZ-204 questions linked to Monitor, troubleshoot, and optimize Azure solutions.
AZ-204 fundamentals practice questions
Practise AZ-204 questions linked to AZ-204 fundamentals.
AZ-204 scenario practice questions
Practise AZ-204 questions linked to AZ-204 scenario.
AZ-204 troubleshooting practice questions
Practise AZ-204 questions linked to AZ-204 troubleshooting.
Practice this exam
Start a free AZ-204 practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this AZ-204 question test?
Develop Azure compute solutions — This question tests Develop Azure compute solutions — Static NAT maps one inside address to one outside address..
What is the correct answer to this question?
The correct answer is: The application inside the container exits with a non-zero exit code on startup. — Option B is correct because if the application exits with a non-zero exit code, the 'Always' restart policy treats it as a failure and restarts it. This can lead to a continuous restart loop if the application fails immediately on startup. Option A is wrong because CPU/memory limits don't cause restart loops unless the container is repeatedly terminated (OOMKilled), but that would show a crash. Option C is wrong because volumes causing crashes would exit with non-zero, same as B. Option D is wrong because public IP assignment doesn't affect restart behavior.
What should I do if I get this AZ-204 question wrong?
Review the four NAT address types (inside local, inside global, outside local, outside global), PAT port overload, and static vs dynamic NAT use cases. Then practise related AZ-204 NAT questions on configuration and troubleshooting.
Are there clue words in this question I should notice?
Yes — watch for: "most likely", "always". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
What is the key concept behind this question?
Static NAT maps one inside address to one outside address.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Keep practising
More AZ-204 practice questions
- An app must store relational state and perform transactions across multiple tables with T-SQL support. Which Azure data…
- You are monitoring an Azure App Service using Application Insights. You notice that the server response time is high for…
- Which TWO services can be used to implement a publish-subscribe messaging pattern in Azure?
- You need to monitor the CPU utilization of an Azure VM in real-time and set up an alert when it exceeds 90%. Which Azure…
- You are monitoring an Azure web application with Application Insights. You notice a sudden increase in the number of fai…
- You are monitoring an Azure web app using Application Insights. You need to create a query that returns the average dura…
Last reviewed: Jun 21, 2026
This AZ-204 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-204 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.