microsoft AI-200: Developing AI Cloud Solutions on Azure · Practice questions

4. Secure, monitor, and troubleshoot Azure solutions Practice Questions

Review 10 sample questions with their correct answers and explanations. Sign up free to continue with the full topic quiz.

Sign up free for the full quiz

Question 1

A Python service must send traces, metrics and logs to Application Insights using OpenTelemetry with minimal code. What should you use?

  1. The Azure Monitor OpenTelemetry Distro with configure_azure_monitor() — Correct
  2. Azure Monitor Agent on the container
  3. The classic Application Insights SDK with an instrumentation key and manual tracking calls
  4. A custom HTTP exporter written from scratch

Correct answer

The Azure Monitor OpenTelemetry Distro with configure_azure_monitor()

Explanation

The Azure Monitor OpenTelemetry Distro configures exporters and common instrumentations with one call.

Question 2

Several microservices share settings such as API base URLs and timeouts, with different values for dev and prod. Where should these settings be centralized?

  1. Azure App Configuration, using labels for environments — Correct
  2. Each service's Docker image
  3. A shared Excel file
  4. Key Vault secrets, with one secret per setting and environment

Correct answer

Azure App Configuration, using labels for environments

Explanation

App Configuration centralizes settings, and labels let the same key have different values per environment.

Question 3

You must audit who read a particular secret in Key Vault and when. What should be enabled?

  1. Diagnostic settings that send AuditEvent logs to Log Analytics — Correct
  2. Soft delete, which records each read of a secret in the vault's version history
  3. A private endpoint
  4. Purge protection

Correct answer

Diagnostic settings that send AuditEvent logs to Log Analytics

Explanation

Key Vault audit events record data-plane operations, including secret reads, with the caller identity.

Question 4

Which code pattern lets the same application authenticate to Key Vault with a developer's credentials locally and a managed identity in Azure?

  1. Use DefaultAzureCredential with SecretClient — Correct
  2. Use a different SDK in each environment
  3. ManagedIdentityCredential everywhere, with a local emulator for development
  4. Use the vault's connection string

Correct answer

Use DefaultAzureCredential with SecretClient

Explanation

DefaultAzureCredential tries several credential sources in order, including developer tools locally and managed identity in Azure.

Question 5

An app must sign requests with a private key kept in a hardware-backed store and never exported. Which Key Vault object and tier fit?

  1. A certificate in App Configuration
  2. A secret containing the PEM-encoded key in a Standard vault
  3. A key stored in an app setting
  4. A key in a Premium vault (HSM-protected) or a Managed HSM — Correct

Correct answer

A key in a Premium vault (HSM-protected) or a Managed HSM

Explanation

HSM-protected keys in Premium vaults or Managed HSM keep key material inside hardware and allow cryptographic operations without exporting the key.

Question 6

A KQL query should show only the five slowest dependency calls to Azure OpenAI in the last hour. Which query fits?

  1. dependencies | where duration < 5
  2. dependencies | summarize count() by type
  3. dependencies | where target has 'openai' | take 5 | order by duration desc
  4. dependencies | where timestamp > ago(1h) and target has 'openai' | top 5 by duration desc — Correct

Correct answer

dependencies | where timestamp > ago(1h) and target has 'openai' | top 5 by duration desc

Explanation

Filter by time and target, then use top N by duration descending.

Question 7

You need to list the exceptions that occurred during failed requests, joined on the operation. Which KQL operator combines the two tables?

  1. render
  2. join on operation_Id — Correct
  3. project
  4. union with a where filter on operation_Id

Correct answer

join on operation_Id

Explanation

join combines rows from requests and exceptions that share the same operation_Id.

Question 8

Which KQL query returns the number of distinct users that called the API today?

  1. requests | where timestamp > startofday(now()) | summarize dcount(user_Id) — Correct
  2. requests | summarize sum(user_Id)
  3. requests | where timestamp > ago(1d) | summarize count() by user_Id
  4. requests | distinct timestamp

Correct answer

requests | where timestamp > startofday(now()) | summarize dcount(user_Id)

Explanation

dcount() returns the approximate number of distinct values.

Question 9

You want a custom span around the embedding generation step that records the model name and token count. What should you do?

  1. Add a metric alert
  2. Create a new Application Insights resource
  3. Write a log line with the model name and token count at the start of the step
  4. Start a span with tracer.start_as_current_span and set attributes on it — Correct

Correct answer

Start a span with tracer.start_as_current_span and set attributes on it

Explanation

Custom spans measure a unit of work, and attributes carry contextual data such as model name and tokens.

Question 10

Logs show a spike in latency for one service. You want to find which dependency in the trace contributed the most time. Where should you look?

  1. The Key Vault audit log
  2. The Container Apps revision list
  3. The end-to-end transaction details for a sample trace in Application Insights — Correct
  4. The Azure Activity log for the resource group, filtered to the slow service

Correct answer

The end-to-end transaction details for a sample trace in Application Insights

Explanation

End-to-end transaction views show each span's duration within the trace, so you can find the slow dependency.

Ready for the full quiz?

Create a free QuizAnalyst account to practice the complete question set and save your progress.

Sign up free for the full quiz