Question 101 of 997
Develop Azure compute solutionsmediumMultiple ChoiceObjective-mapped

Quick Answer

The correct approach is to use a secure environment variable with a Key Vault reference syntax, such as `secret://myvault/secretname`. This works because Azure Container Instances natively supports the `secret://` scheme in environment variable definitions, allowing the ACI infrastructure to authenticate to Key Vault using the container group’s system-assigned managed identity and inject the secret at runtime—without ever exposing the value in the YAML deployment file or requiring modifications to the container image. On the AZ-204 exam, this scenario tests your understanding of managed identities and secure secret injection patterns, often appearing as a distractor against options like mounting secrets as volumes or passing them as plain-text environment variables. A common trap is assuming you need to write custom code to call the Key Vault SDK, but ACI handles the retrieval automatically. Memory tip: think “secret://” as a secure shortcut—like a direct line from your container to the vault, no code required.

AZ-204 Develop Azure compute solutions Practice Question

This AZ-204 practice question tests your understanding of develop azure compute solutions. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. A key principle to apply: aCI resolves Key Vault references at runtime using the container group's managed identity.. 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 (ACI). The application requires a connection string to an Azure SQL Database. The connection string contains a password that is stored as a secret in Azure Key Vault. The container image expects to read the connection string from an environment variable named SQL_CONNECTION_STRING. You want to pass the secret securely without embedding it in the YAML deployment file and without modifying the container image. The ACI container group will use a system-assigned managed identity that has access to the Key Vault secret. Which approach should you use?

Question 1mediummultiple 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 secure environment variable with a Key Vault reference syntax (e.g., secret://myvault/secretname)

Option B is correct because Azure Container Instances supports Key Vault references in environment variables using the `secret://` syntax, which allows you to securely inject secrets into containers at runtime without exposing them in the deployment YAML. The system-assigned managed identity is automatically used by the ACI infrastructure to authenticate to Key Vault and retrieve the secret, so no code changes to the container image are required.

Key principle: ACI resolves Key Vault references at runtime using the container group's managed identity.

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 a volume from Azure Files containing the connection string

    Why it's wrong here

    This stores the secret in a file share, which is not secure and adds management overhead; it also requires writing the secret to the share.

  • Use a secure environment variable with a Key Vault reference syntax (e.g., secret://myvault/secretname)

    Why this is correct

    ACI resolves the Key Vault reference at runtime using the managed identity, keeping the secret out of the deployment definition and requiring no image changes.

    Related concept

    ACI resolves Key Vault references at runtime using the container group's managed identity.

  • Use the managed identity inside the container to call the Key Vault SDK and retrieve the secret

    Why it's wrong here

    This requires modifying the container image to include code to retrieve the secret, which violates the constraint of not modifying the image.

  • Store the connection string as an environment variable in ACI configuration but mark it as secure

    Why it's wrong here

    Secure environment variables in ACI are still stored in the configuration and can be viewed by anyone with access to the deployment definition.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often assume they must write code inside the container to use the managed identity with the Key Vault SDK, but ACI provides a built-in mechanism to inject secrets as environment variables without any code changes.

Detailed technical explanation

How to think about this question

The `secret://` reference syntax in ACI works by having the ACI resource provider call Azure Key Vault on your behalf during container group creation, using the managed identity assigned to the container group. The secret is resolved before the container starts, and the environment variable is set to the actual value in memory, never written to disk or logs. This approach is similar to how Azure App Service and Azure Functions support Key Vault references, but ACI uses a different syntax (`secret://`) and does not support the `@Microsoft.KeyVault()` syntax used in App Service.

KKey Concepts to Remember

  • ACI resolves Key Vault references at runtime using the container group's managed identity.
  • The `secret://` URI syntax is used to reference Key Vault secrets in ACI environment variables.
  • Secrets are injected as standard environment variables into the container after resolution.
  • This method prevents secrets from being exposed in deployment YAML or container images.

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

ACI resolves Key Vault references at runtime using the container group's managed identity.

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 aCI resolves Key Vault references at runtime using the container group's managed identity., then practise related AZ-204 questions on the same topic to reinforce the concept.

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 — ACI resolves Key Vault references at runtime using the container group's managed identity..

What is the correct answer to this question?

The correct answer is: Use a secure environment variable with a Key Vault reference syntax (e.g., secret://myvault/secretname) — Option B is correct because Azure Container Instances supports Key Vault references in environment variables using the `secret://` syntax, which allows you to securely inject secrets into containers at runtime without exposing them in the deployment YAML. The system-assigned managed identity is automatically used by the ACI infrastructure to authenticate to Key Vault and retrieve the secret, so no code changes to the container image are required.

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

Review aCI resolves Key Vault references at runtime using the container group's managed identity., then practise related AZ-204 questions on the same topic to reinforce the concept.

What is the key concept behind this question?

ACI resolves Key Vault references at runtime using the container group's managed identity.

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

Keep practising

More AZ-204 practice questions

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.