Question 243 of 997
Develop Azure compute solutionshardMultiple ChoiceObjective-mapped

Quick Answer

The correct approach is to use a managed identity for the container group, grant that identity access to an Azure Key Vault secret containing the storage account connection string, and have the application retrieve the secret at startup using the managed identity before writing directly to Azure Blob Storage. This works because managed identities provide an automatically managed service principal in Azure Active Directory, allowing the container instance to authenticate to Key Vault without any credentials hardcoded or passed as environment variables, thus securely passing connection strings to Azure Container Instances at runtime without exposure in the ACI configuration. On the AZ-204 exam, this scenario tests your understanding of managed identities combined with Key Vault for secret injection, often appearing as a distractor against less secure options like mounting secrets as environment variables or using connection strings in the container definition. A common trap is choosing to store the connection string directly in the container group’s environment variables, which would expose it in plaintext. Remember the mnemonic “MIVault” — Managed Identity plus Key Vault keeps secrets out of sight.

AZ-204 Develop Azure compute solutions Practice Question

This AZ-204 practice question tests your understanding of develop azure compute solutions. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. 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 batch processing application to Azure Container Instances (ACI). The application processes multiple files from an Azure Blob Storage container and writes results to another container. Each container instance processes a single file and then exits. The processing logic is written in a Docker image that reads input and output connection strings from environment variables. You need to configure the container group so that it writes the results to the output container durably and efficiently. The environment variables must be provided at runtime but must not be exposed in the ACI configuration. Which approach should you use?

Question 1hardmultiple choice
Full question →

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

Use a managed identity for the container group, grant the identity access to an Azure Key Vault secret that contains the storage account connection string. The application retrieves the secret at startup using the managed identity and then writes directly to Azure Blob Storage.

Option B is correct because it uses a managed identity to securely retrieve the storage account connection string from Azure Key Vault at runtime, ensuring the secret is never exposed in the ACI configuration. The application writes directly to Azure Blob Storage, which is durable and efficient for blob output. This approach aligns with the requirement to avoid exposing environment variables in the ACI configuration while providing them at runtime.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Mount an Azure File Share volume for the output container and configure the application to write output files to a directory on that share. Store the connection string for the file share in a secure fashion using Key Vault and pass it as an environment variable.

    Why it's wrong here

    While using Azure File Share is durable, the requirement is to write results back to Blob Storage (output container), not a file share. Also, the application is designed to use Blob Storage SDK, not file system I/O.

  • Use a managed identity for the container group, grant the identity access to an Azure Key Vault secret that contains the storage account connection string. The application retrieves the secret at startup using the managed identity and then writes directly to Azure Blob Storage.

    Why this is correct

    This approach uses managed identity to securely access Key Vault, avoiding any credentials in the container configuration. The application then uses the connection string to write to Blob Storage via the SDK, which is efficient and durable.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Embed the storage account connection string directly into the Docker image during build time and rely on the container's environment to provide the output blob container name.

    Why it's wrong here

    Embedding secrets in a Docker image is insecure and makes rotation difficult. It also violates the principle of least privilege.

  • Set the storage account connection string as an environment variable in the ACI container group definition (YAML or ARM template) and have the application use it at runtime.

    Why it's wrong here

    Setting secrets as environment variables in the ACI configuration exposes them in the deployment artifacts and logs. This is not secure; secrets should be retrieved from a secure store like Key Vault.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates may choose Option A, thinking a file share mount is more durable or simpler, but the question explicitly requires writing to a blob container, and direct blob writes via a securely retrieved connection string are both more efficient and aligned with the requirement to avoid exposing secrets in the ACI configuration.

Trap categories for this question

  • Command / output trap

    While using Azure File Share is durable, the requirement is to write results back to Blob Storage (output container), not a file share. Also, the application is designed to use Blob Storage SDK, not file system I/O.

Detailed technical explanation

How to think about this question

Managed identities for Azure resources provide an automatically managed service principal in Azure AD, allowing the container group to authenticate to Key Vault without any secrets in code or configuration. The application uses the Azure Identity SDK (e.g., DefaultAzureCredential) to obtain an access token for Key Vault, then retrieves the connection string via the Key Vault Secrets client. This pattern is common in production scenarios where secrets must be rotated without redeploying containers, and it avoids the overhead of mounting file shares for blob output.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A media company stores terabytes of video archives that are accessed once a year for audit purposes. Moving these objects to a cold storage tier (Azure Archive, S3 Glacier, or Google Nearline) costs a fraction of hot storage. Questions like this test whether you understand storage tiers, access frequency tradeoffs, and retrieval latency requirements.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

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.

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 — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Use a managed identity for the container group, grant the identity access to an Azure Key Vault secret that contains the storage account connection string. The application retrieves the secret at startup using the managed identity and then writes directly to Azure Blob Storage. — Option B is correct because it uses a managed identity to securely retrieve the storage account connection string from Azure Key Vault at runtime, ensuring the secret is never exposed in the ACI configuration. The application writes directly to Azure Blob Storage, which is durable and efficient for blob output. This approach aligns with the requirement to avoid exposing environment variables in the ACI configuration while providing them at runtime.

What should I do if I get this AZ-204 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

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 →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

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.

Loading comments…

Sign in to join the discussion.

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.