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)
Related AI-200 questions
- A developer has built an image named aiservice:v1 on their workstation. They want to catch startup or runtime errors…Develop Containerized Solutions on Azure
- An AKS cluster is shared by several teams, each working in its own namespace.Develop Containerized Solutions on Azure
- A security-focused team is adding a Linux user node pool to an AKS Standard cluster.Develop Containerized Solutions on Azure
- A team runs a business-critical AI inference service on an AKS cluster created in the Free pricing tier.Develop Containerized Solutions on Azure
All 60 free AI-200 questions by domain · 15 sample questions on one page
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.