Skip to main content

AI-200 practice question · Develop Containerized Solutions on Azure

An AI service runs in Azure Container Apps and needs an Azure OpenAI API key at runtime.

An AI service runs in Azure Container Apps and needs an Azure OpenAI API key at runtime. Security policy says the key value must be kept only in Azure Key Vault, not in the container app's configuration, the container image, or deployment templates. Rotating the key in Key Vault must not require editing the app's configuration. What should you do?

  • ADefine an app secret as a Key Vault reference using the app's managed identity, and map it to an env var via secretRef
  • BDefine an app secret with the key value entered directly, and map it to an environment variable via secretRef
  • CAdd the key to the Dockerfile with an ENV instruction so that it's built into the image during the CI build
  • DSet the key as a plain environment variable value in the container template of the app's deployment file
Show the answer and explanation

Correct answer: A) Define an app secret as a Key Vault reference using the app's managed identity, and map it to an env var via secretRef

A Container Apps secret defined as a Key Vault reference stores only a pointer to the secret. The platform reads the value with the app's managed identity and exposes it through secretRef or a secret volume. With a versionless URI, the app picks up rotated values automatically.

Why each option is right or wrong

  • A) Correct. A Key Vault reference secret stores only the Key Vault secret URI and the identity to use. Container Apps retrieves the value with the app's managed identity, which needs the Key Vault Secrets User role. If the URI has no version, the app picks up the latest version within 30 minutes and restarts revisions that reference it in environment variables.
  • B) Incorrect. A secret entered directly stores the key value in the container app's own configuration, which the policy forbids. Rotating the key would also mean updating the secret in the app. Microsoft recommends Key Vault references instead of direct values in production.
  • C) Incorrect. This puts the key value inside an image layer, so anyone who can pull the image can read it. Rotating the key would also require rebuilding and redeploying the image.
  • D) Incorrect. A plain environment variable value is stored as-is in the container template and the deployment file. That breaks the policy, and rotating the key would require changing the template.
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.