Skip to main content

AI-200 practice question · Develop Containerized Solutions on Azure

A team needs to give one Azure Container App a small, app-specific API key.

A team needs to give one Azure Container App a small, app-specific API key. The container should read the key from an environment variable, and the team doesn't want to create a Key Vault for this one value. What should they do?

  • ADefine the key as a secret in the container app's configuration and reference it from the environment variable with secretRef
  • BDefine the key as a shared secret on the Container Apps environment so that every app in the environment can reference it
  • CAdd the key to the container's env list as a plain name/value pair in the revision template
  • DSet the key with an ENV instruction in the Dockerfile and rebuild and push the container image
Show the answer and explanation

Correct answer: A) Define the key as a secret in the container app's configuration and reference it from the environment variable with secretRef

Azure Container Apps has a built-in secrets store at the application level. Environment variables (and scale rules) reference these secrets with secretRef, and each secret can hold the value directly or point to a Key Vault secret.

Why each option is right or wrong

  • A) Correct. Container Apps secrets are name/value pairs defined at the application level. An environment variable can reference a secret with secretRef (secretref:<name> in the Azure CLI). The value can be stored directly in Container Apps or, for production, can be a Key Vault reference.
  • B) Incorrect. Container Apps secrets are scoped to an individual application, not to the environment. Each app defines its own secrets, and its revisions reference them.
  • C) Incorrect. A plain environment variable value is part of the app's template and isn't stored as a secret. The documented approach is to define a secret and reference it with secretRef.
  • D) Incorrect. Baking a secret into the image exposes it to anyone who can pull the image and inspect its layers. It also means rebuilding the image whenever the key changes.
Exam domain
Develop Containerized Solutions on Azure · 22% of AI-200
Question type
Multiple choice (one answer)

Practise the full AI-200 exam

This question is one of a small free sample from the CertRidge AI-200 bank. Full practice exams match the real exam's length, time limit and domain weights, explain every option, and Review Mode re-drills the questions you miss.

Original question written from the official exam guide. Not affiliated with Microsoft; never copied from the real exam.