AZ-204 Develop Azure compute solutions Practice Question
Your company is deploying a multi-container application using Azure Container Instances (ACI) in a virtual network. You need to ensure that containers can communicate with each other using localhost. Which TWO actions should you take?
⚠ Common exam trap
A common mix-up: candidates confuse container groups with separate containers in a Docker Compose or Kubernetes pod context, assuming that localhost communication requires explicit network configuration or service discovery, when in fact ACI container groups inherently share the same network namespace.
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
✓
Deploy all containers in the same container group.
Containers within the same container group in Azure Container Instances share the same network namespace, including the same IP address and port space. This allows them to communicate over localhost (127.0.0.1) without additional configuration, as they are essentially running on the same virtual machine. Option E is incorrect because using the container group's FQDN does not enable localhost communication; the FQDN resolves to the group's IP address, which is not localhost. Containers in the same group can communicate via localhost directly, without needing the FQDN.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Define environment variables on each container with the hostnames.
Why it's wrong here
Environment variables with hostnames do not enable localhost communication; they are just configuration settings.
- ✓
Deploy all containers in the same container group.
Why this is correct
Correct. Containers in the same container group share the same network namespace, enabling localhost communication.
- ✗
Assign different private IP addresses to each container.
Why it's wrong here
Assigning different private IP addresses would prevent localhost communication; containers must share the same IP to use localhost.
- ✗
Deploy containers in separate container groups and use service discovery.
Why it's wrong here
Deploying containers in separate container groups would require network communication over the virtual network, not localhost.
- ✗
Use the container group's fully qualified domain name (FQDN) to communicate.
Why it's wrong here
Incorrect. The FQDN resolves to the container group's IP address, which is not localhost. For localhost communication, containers must be in the same group.
Visual reference
Go deeper
Related to this question
About these practice questions
One of 881 original AZ-204 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.