Home Microsoft AI-200: Azure AI Cloud Developer AI-200 Questions 31-40: Security and Observability

AI-200 Questions 31-40: Security and Observability

0
14
AI-200 security and observability questions 31-40, Set 4: Key Vault, App Configuration, OpenTelemetry, and KQL

Exam AI-200: Developing AI Cloud Solutions on Azure includes the Secure, monitor, and troubleshoot Azure solutions domain, worth 20–25% of the exam. This domain tests secret handling, application configuration, distributed tracing, and log analysis. These AI-200 security and observability questions cover Key Vault access, configuration labels, OpenTelemetry context, and KQL queries.

This is the fourth set in our Azure AI Cloud Developer Associate AI-200 series (Questions 31-40). It follows AI-200 Questions 21-30 on Redis caching and event processing. Every question is an original practice scenario mapped to the official exam objectives, not a copy of a real exam item.

Separate authentication from permission to read a secret. For tracing and KQL, identify the context or grouping boundary before choosing a code change.

Question 31: Read a Stored Credential

A Python service has an authenticated Key Vault SecretClient named client. The existing secret partner-token contains the credential needed for an outbound request. The service must retrieve its contents without modifying the secret. Which expression provides the stored value?

A) client.set_secret("partner-token", "replacement").value

B) client.get_secret("partner-token").name

C) client.get_secret("partner-token").value

D) client.begin_delete_secret("partner-token").result().name

👁 Reveal Answer

Correct Answer: C

Explanation: C retrieves the secret with the Python secrets client and reads its value property. The returned object also contains identifying information, so selecting the right property matters. A writes a replacement rather than performing the required read-only operation. B returns the secret’s name, not its credential contents. D starts a deletion and returns identifying information from the result, violating both the retrieval and no-modification requirements.

Reference: Azure Key Vault Python client library: retrieve a secret

Question 32: Remove an Application Password

A Python API uses DefaultAzureCredential with SecretClient. Locally, the developer signs in through Azure CLI. In App Service, the API must authenticate to Key Vault without storing a client secret. Required secret-read permissions will be assigned separately. Which production identity setup meets this requirement?

A) Enable a system-assigned managed identity on the web app.

B) Store an app registration password in the web app settings.

C) Store the developer’s sign-in password in the web app settings.

D) Remove the credential argument from the secrets client setup.

👁 Reveal Answer

Correct Answer: A

Explanation: A supplies an Azure-managed identity that DefaultAzureCredential can discover when the API runs in App Service. This avoids maintaining an application password while allowing the existing credential abstraction to support local development. Authorization still needs the separate role assignment stated in the scenario. B introduces the client secret that the requirement forbids. C stores a personal password and is not the managed-identity approach. D does not establish authenticated access to Key Vault.

Reference: Azure Key Vault Python quickstart: authenticate and create a client

Question 33: Grant Runtime Secret Access

A workload’s managed identity authenticates successfully to a Key Vault that uses the Azure RBAC permission model. Network access is working. The vault is dedicated to this application and environment. The identity must read secret contents but must not create, update, or delete secrets. Which built-in role should be assigned at the vault scope?

A) Assign the Key Vault Reader role to the identity.

B) Assign the Key Vault Contributor role to the identity.

C) Assign the Key Vault Secrets Officer role to the identity.

D) Assign the Key Vault Secrets User role to the identity.

👁 Reveal Answer

Correct Answer: D

Explanation: D grants the secret-content read access that the runtime needs without granting secret modification operations. The dedicated application vault makes a vault-scope assignment appropriate. A reads metadata but cannot read sensitive secret values. B manages the vault through the control plane and does not grant access to its secret contents. C permits broader secret management, including changes, so it exceeds the stated runtime permissions.

Reference: Key Vault Azure RBAC: built-in roles for data plane operations

Question 34: Diagnose a Rotation Failure

A legacy workload requires SQL password authentication. Its rotation handler creates a new Key Vault secret version containing a new password, but the subsequent SQL Server password update fails. The application retrieves the new secret successfully, yet database sign-in fails. What should the operator investigate first?

A) Whether the application’s vault role permits secret deletion.

B) Whether the SQL login still uses the previous stored password.

C) Whether the secret’s expiration date must match the old version.

D) Whether the application’s vault-read role has finished propagating.

👁 Reveal Answer

Correct Answer: B

Explanation: B checks the credential mismatch caused by the failed target update. Rotating a stored password requires coordinating Key Vault’s new secret value with the service that validates that password. Successful vault retrieval does not prove successful SQL rotation. A is unrelated because the application does not need deletion rights to sign in to SQL. C focuses on expiration metadata rather than reconciling the SQL login’s password. D does not explain this failure because the application successfully retrieved the new secret.

Reference: Key Vault secret rotation: coordinating the secret and SQL Server password

Question 35: Keep Environment Variants Together

A team stores nonsecret service endpoints in one Azure App Configuration store. Test and production must use different values for the same key, Search:Endpoint. The application selects its environment explicitly when loading settings. Which design preserves the shared key name with the least naming overhead?

A) Store one value and distinguish environments through content type.

B) Store two values with labels Test and Production for that key.

C) Store two values by changing only the capitalization of that key.

D) Store one value and distinguish environments through its delimiter.

👁 Reveal Answer

Correct Answer: B

Explanation: B uses labels to distinguish configuration variants that share a key name. App Configuration uniquely identifies a key-value by its key and label, so each environment can retrieve its own endpoint. A uses content type to describe a value’s format, not to store two environment variants of one key. C creates distinct case-sensitive key names and violates the shared-name requirement. D changes naming structure but does not create two labeled values.

Reference: Understand App Configuration key-values: label keys

Question 36: Narrow a Configuration Read

A REST client reads key-values from Azure App Configuration. It needs all keys beginning with Search: and only values whose label is exactly Production. It must avoid retrieving Test or unlabeled variants. Which pair of REST query filters selects the required settings?

A) key=Search:* and label=*

B) key=Search: and label=Production

C) key=Search:* and label=%00

D) key=Search:* and label=Production

👁 Reveal Answer

Correct Answer: D

Explanation: D combines a key-prefix pattern with an exact label match. The trailing wildcard includes keys such as Search:Endpoint and Search:Timeout, while the label filter selects only Production variants. A permits every label, including Test and the null label. B matches the literal key Search: rather than keys beginning with that prefix. C explicitly selects unlabeled values through the encoded null label instead of selecting Production.

Reference: Understand App Configuration key-values: query key-values

Question 37: Reconnect a Function’s Trace

An existing Python Azure Functions application uses the Azure Monitor OpenTelemetry distro. A handler’s custom span appears in a separate trace from the incoming request. The Functions context exposes valid traceparent and tracestate values, but the handler never extracts them. Which change directly restores correlation?

A) Extract those values as a carrier and pass the context when starting the span.

B) Give every handler span the same name as the incoming HTTP request.

C) Write those values into a log message and start the span without that context.

D) Generate fresh trace context in the handler before starting its custom span.

👁 Reveal Answer

Correct Answer: A

Explanation: A follows the documented Functions correlation pattern: place traceparent and tracestate in a carrier, extract the OpenTelemetry context, and supply it to start_as_current_span. This carries the incoming request’s tracing context into the handler’s span. B changes a display name but not trace parentage. C records text without establishing the span’s parent context. D creates unrelated context and preserves the separation that the team needs to fix.

Reference: Azure Monitor OpenTelemetry Python distro: trace correlation in Azure Functions

Question 38: Scope a Custom Operation

A Python service already has working OpenTelemetry export. A document-ranking operation needs a custom span that is current while its synchronous work executes and ends when that scope exits. The developer wants to avoid manually managing activation and span completion. Which pattern meets the requirement?

A) Add a counter measurement immediately before running the ranking work.

B) Log a ranking-start message immediately before running the ranking work.

C) Run the ranking work inside a tracer.start_as_current_span context manager.

D) Obtain a tracer object immediately before running the ranking work.

👁 Reveal Answer

Correct Answer: C

Explanation: C starts a custom span, makes it current inside the Python with scope, and ends it when that scope exits. This gives the operation a tracing boundary without separate activation and completion calls. A records a metric rather than a timed tracing operation. B records a log message without creating the requested span. D only obtains the object used to create spans; it does not start or activate one.

Reference: Add and modify OpenTelemetry: custom spans in Python

Question 39: Select Recent Slow Operations

An Azure Monitor custom log table, RankingRuns_CL, has datetime column TimeGenerated and numeric column DurationMs. An operator needs only rows from the last hour whose duration exceeds 2000 milliseconds. Which predicate should follow the table name in the KQL query?

A) | where TimeGenerated >= ago(1h) and DurationMs > 2000

B) | where TimeGenerated >= ago(1h) or DurationMs > 2000

C) | where TimeGenerated < ago(1h) and DurationMs > 2000

D) | where TimeGenerated >= ago(1h) and DurationMs <= 2000

👁 Reveal Answer

Correct Answer: A

Explanation: A uses where to retain rows satisfying both required conditions: a recent timestamp and a duration strictly above the threshold. Comparing the timestamp column directly to ago is also the documented filtering pattern. B admits recent fast rows and older slow rows because either condition is sufficient. C selects timestamps older than the required window. D selects durations at or below the threshold, excluding the slow operations the operator wants.

Reference: KQL where operator: predicates and timestamp comparisons

Question 40: Group Failures into Time Windows

A KQL pipeline has already filtered a custom operations log to failed rows. Each row has a datetime TimeGenerated and a string ServiceName. The dashboard needs one failure count for each service and each five-minute time bucket represented in those rows. Which final operator provides that output?

A) | summarize Failures=count() by ServiceName, TimeGenerated

B) | summarize Failures=count() by bin(TimeGenerated, 5m)

C) | summarize Failures=count() by ServiceName

D) | summarize Failures=count() by ServiceName, bin(TimeGenerated, 5m)

👁 Reveal Answer

Correct Answer: D

Explanation: D groups the already-filtered failure rows by service and explicitly binned timestamp, then counts the rows in each group. It returns the requested service-by-time breakdown for buckets represented in the input; it does not fill empty buckets. A groups by exact timestamps rather than five-minute windows. B combines services within each time bucket. C combines all represented times within each service, losing the dashboard’s time dimension.

Reference: KQL summarize operator: grouping and explicit time bins

Study Tips for Security and Observability

  • Identity versus access. Managed identity removes an application password, while a data-plane role grants permission to read the stored secret.
  • Coordinated rotation. A new secret version is not proof that the target service now accepts the new credential.
  • Selection versus context. App Configuration labels select setting variants; OpenTelemetry context connects operations within a trace.
  • Filter before grouping. Choose the rows with where, then use summarize and explicit time bins to build the required breakdown.

Keep Practicing for Azure AI Cloud Developer

Use these AI-200 security and observability questions to guide small secret-read, configuration-filter, and log-query labs. Revisit AI-200 Questions 21-30 for caching and event processing. The final planned set, Questions 41-50, will be a mixed cloud developer review covering containers, data services, Functions, messaging, and tracing.

Cloud Tech
Cloud Tech is a small, independent team that writes free practice questions for Microsoft Azure, AWS and CompTIA certification exams. We write every question ourselves against the current official exam outline, explain why each option is right or wrong, link to the vendor's documentation, and update or archive sets when an exam changes. Spotted a mistake? Email [email protected].