Implement and configure security controls by using Azure Policy, including built-in and custom policy definitions (SC-500 Exam Prep)

This post is a part of the "SC-500: Implementing End-to-End Security Controls for Cloud and AI Workloads" Exam Prep Hub.
This topic falls under these sections:
Manage identity, access, and governance (20–25%)
   --> Implement governance to enforce security and regulatory compliance
      --> Implement and configure security controls by using Azure Policy, including built-in and custom policy definitions


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Overview

Azure Policy is a governance service that helps organizations define, enforce, and assess rules for Azure resources. It can be used to ensure that resources comply with organizational security requirements, regulatory standards, naming conventions, tagging requirements, and configuration standards.

For the SC-500 exam, it is important to understand that Azure Policy is primarily about resource governance and compliance, whereas Microsoft Entra ID and Azure RBAC are primarily concerned with identity and authorization.

Azure Policy evaluates resources against policy definitions and determines whether those resources comply with the organization’s requirements. Depending on the policy effect, Azure Policy can:

  • Block a resource deployment.
  • Audit a resource without blocking it.
  • Modify resource properties.
  • Automatically deploy required configuration.
  • Prevent specific resource actions.
  • Identify resources that should have related resources or configurations.
  • Report compliance status.

Policies can be assigned at different scopes, including management groups, subscriptions, resource groups, and individual resources.


1. Understanding Azure Policy

Azure Policy follows a relatively simple conceptual model:

Policy definition → Assignment → Evaluation → Compliance result / Enforcement

For example, an organization might have a security requirement:

All Azure Storage accounts must disable public network access.

A policy definition can describe that requirement. The policy can then be assigned to a subscription or management group.

Azure Policy evaluates resources within the assignment scope and determines whether each resource complies.

Example

Suppose a subscription contains:

  • Storage account A — public network access disabled
  • Storage account B — public network access enabled
  • Storage account C — public network access disabled

A policy requiring public network access to be disabled would report:

ResourceCompliance
Storage ACompliant
Storage BNon-compliant
Storage CCompliant

If the policy uses the Deny effect, a future attempt to create or update a non-compliant resource can be blocked.


2. Azure Policy vs. Azure RBAC

This is an important distinction for the SC-500 exam.

Azure RBAC

Azure RBAC answers:

Who is allowed to do something?

For example:

Allow the Storage Administrator role to manage storage accounts.

Azure Policy

Azure Policy answers:

What configurations or actions are allowed or required?

For example:

Storage accounts must use private endpoints.

These services complement each other.

An administrator could have permission to create a storage account through RBAC but still be prevented from creating it in a prohibited region because Azure Policy applies a Deny policy.


3. Policy Definitions

A policy definition describes the rule that Azure Policy evaluates.

Policy definitions are expressed in JSON and contain information such as:

  • Display name
  • Description
  • Mode
  • Parameters
  • Metadata
  • Policy rule
  • Effect

The policy rule contains an if portion and a then portion. The if portion identifies the resources or conditions that should trigger the policy. The then portion specifies what Azure Policy should do when the condition is met.

Conceptually:

IF resource meets condition
THEN apply effect

For example:

IF location is not one of the approved locations
THEN deny deployment

4. Built-in Policy Definitions

Azure provides a large collection of built-in policy definitions.

Built-in policies are created and maintained by Microsoft.

Examples include policies that:

  • Restrict allowed Azure regions.
  • Require specific tags.
  • Audit unencrypted resources.
  • Require secure configurations.
  • Restrict resource types.
  • Require diagnostic settings.
  • Enforce network security configurations.
  • Require Microsoft Defender protections.

Built-in policies can significantly reduce development and maintenance effort because you don’t need to create a custom policy for requirements that Azure Policy already supports.

Exam tip

When a question asks you to implement a standard Azure security requirement and a suitable built-in policy already exists, the built-in policy is frequently the preferred answer.


5. Custom Policy Definitions

A custom policy definition is created by an organization when its requirements aren’t adequately addressed by an existing built-in policy.

Custom policies are useful when an organization has requirements such as:

Every production resource must have a BusinessOwner tag.

Or:

Storage accounts used by the Finance workload must use a specific configuration.

Or:

Only approved VM SKUs may be deployed in a particular environment.

Custom policies are also useful when an organization wants to encode its own internal security standards.

The basic process is:

  1. Identify the organizational requirement.
  2. Determine which resource types and properties must be evaluated.
  3. Identify the appropriate policy aliases.
  4. Define the policy parameters.
  5. Define the if conditions.
  6. Define the appropriate effect.
  7. Create the policy definition.
  8. Assign the policy.
  9. Monitor compliance.
  10. Remediate non-compliant resources when applicable.

6. Policy Definition Structure

A simplified Azure Policy definition looks like this:

{
"properties": {
"displayName": "Require approved locations",
"description": "Restricts resources to approved Azure regions.",
"mode": "Indexed",
"parameters": {
"allowedLocations": {
"type": "array"
}
},
"policyRule": {
"if": {
"not": {
"field": "location",
"in": "[parameters('allowedLocations')]"
}
},
"then": {
"effect": "deny"
}
}
}
}

The important components are:

displayName

Human-readable name for the policy.

description

Explains the purpose of the policy.

mode

Determines which resource types and properties are evaluated.

parameters

Makes a policy reusable by allowing values to be supplied when the policy is assigned.

policyRule

Contains the actual evaluation logic.

if

Defines the condition that causes the policy to apply.

then

Defines the resulting effect.


7. Policy Parameters

Parameters make policies more reusable.

Instead of creating separate policies such as:

  • Allow East US
  • Allow West US
  • Allow Central US

you can create one policy with an allowedLocations parameter.

Different assignments can then provide different values.

For example:

Policy:
Allowed locations = parameter
Production assignment:
East US
West US
Development assignment:
East US
West US
Central US

This reduces the number of policy definitions that an organization must maintain.

Azure Policy parameters can have types such as:

  • String
  • Array
  • Boolean
  • Integer
  • Float
  • Object
  • DateTime

Parameters are defined in the policy definition and supplied when the policy is assigned.


8. Policy Aliases

Policy aliases allow Azure Policy to reference specific properties of Azure resources.

For example, a policy might need to evaluate a property belonging to:

Microsoft.Storage/storageAccounts

Rather than relying on arbitrary JSON paths, Azure Policy uses aliases to reference resource properties.

Aliases are especially important when creating custom policies.

Why aliases matter

Suppose you want to determine whether a storage account has public network access enabled.

The policy needs to evaluate the corresponding resource property.

An appropriate alias allows the policy to reference that property.

Azure provides aliases for many Azure resource properties, and the list evolves as Azure resource providers evolve. Microsoft recommends tools such as the Azure Policy extension for Visual Studio Code or Azure PowerShell for discovering available aliases.

Array aliases

Azure Policy also supports array aliases using [*].

These allow policy rules to evaluate individual elements of an array property.

For example, a network ACL might contain multiple IP rules. An array alias can allow the policy to evaluate the individual rules rather than treating the entire array as a single value.

Exam tip

If a question asks how to create a custom policy that evaluates a particular Azure resource property, think:

Find the appropriate policy alias.


9. Policy Effects

The effect determines what happens when the policy rule applies.

The effects most important to understand for the SC-500 exam include:

  • Audit
  • Deny
  • Modify
  • DeployIfNotExists
  • AuditIfNotExists
  • Append
  • DenyAction
  • Disabled

Audit

The Audit effect identifies resources that don’t comply without preventing their creation or modification.

Use Audit when you want to:

  • Assess an existing environment.
  • Understand the current compliance state.
  • Introduce a new security requirement gradually.
  • Monitor compliance without breaking deployments.

Example

Requirement:

All storage accounts should use private endpoints.

Using Audit initially allows the organization to discover which resources don’t comply.


10. Deny

The Deny effect prevents resource operations that would violate the policy.

For example:

Prevent users from deploying resources outside approved Azure regions.

A Deny policy can prevent the deployment from occurring.

When to use Deny

Use Deny when the requirement is mandatory and the organization is prepared to enforce it.

Exam distinction

Audit:

“Tell me what’s wrong.”

Deny:

“Don’t allow it.”


11. Modify

The Modify effect can add, update, or remove supported resource properties during resource creation or update.

A common example is automatically adding or updating resource tags.

For example:

If a resource doesn't contain the Environment tag
then add Environment = Production

Modify can also be used with remediation tasks to address existing non-compliant resources.

Policies using Modify require an appropriate managed identity and permissions when remediation requires Azure Policy to make changes.


12. DeployIfNotExists

DeployIfNotExists is used when Azure Policy should deploy a related resource or configuration if it isn’t already present.

For example:

Every Azure VM must have a specific monitoring configuration.

If the configuration doesn’t exist, the policy can trigger a deployment to create it.

This is different from Modify.

Modify

Changes supported properties of the existing resource.

DeployIfNotExists

Deploys a related resource or configuration when a required item doesn’t exist.


13. AuditIfNotExists

AuditIfNotExists identifies resources that don’t have a related resource or configuration.

For example:

Every virtual machine should have a specific monitoring resource associated with it.

If the related resource isn’t present, Azure Policy reports the resource as non-compliant.

It doesn’t automatically deploy the missing configuration.

Easy way to remember

AuditIfNotExists

“Tell me if it doesn’t exist.”

DeployIfNotExists

“If it doesn’t exist, deploy it.”


14. Append

The Append effect can add fields to a resource during creation or update.

It is particularly useful for adding properties to resource requests when the property isn’t already specified.

For many modern scenarios, however, you should understand whether Modify is the more appropriate effect because Modify provides broader property modification capabilities.


15. DenyAction

The DenyAction effect blocks specific actions rather than simply blocking resource creation.

A classic example is preventing deletion of particular resources or preventing certain operations based on policy conditions.

This can provide an additional governance layer for critical resources.


16. Disabled

The Disabled effect effectively turns off enforcement for the policy definition.

This can be useful when:

  • Testing.
  • Temporarily disabling a policy.
  • Retaining the policy definition while disabling its effect.

17. Policy Assignments

Creating a policy definition doesn’t cause Azure resources to be evaluated.

The policy must be assigned.

A policy assignment associates a policy definition with a scope.

Possible scopes include:

  • Management group
  • Subscription
  • Resource group
  • Individual resource

An assignment applies to resources within its scope and can include exclusions.

Example

An organization has:

Management Group
│
├── Production Subscription
│
├── Development Subscription
│
└── Test Subscription

A policy can be assigned at the management-group level.

That allows the organization to establish a common security baseline across the subscriptions beneath it.


18. Management Groups and Azure Policy

Management groups are particularly valuable when an organization needs centralized governance across multiple subscriptions.

For example:

Enterprise Management Group
│
├── Production
│ ├── Subscription A
│ └── Subscription B
│
└── Non-Production
├── Subscription C
└── Subscription D

A security policy could be assigned at the management-group level.

This provides centralized governance while allowing individual subscriptions to remain independently managed.

SC-500 exam consideration

If a question says:

Apply the same security requirement to multiple subscriptions

consider whether the policy should be assigned at a management group rather than individually to every subscription.


19. Policy Initiatives

A policy initiative, also called a policy set, is a collection of related policy definitions.

Instead of assigning 20 individual policies separately, you can group them into a single initiative.

For example:

Secure Storage Initiative

Could contain policies requiring:

  • Secure transfer.
  • Encryption.
  • Private networking.
  • Diagnostic logging.
  • Approved regions.
  • Defender protection.

The initiative can then be assigned as a single governance package.

Azure documentation describes an initiative as a collection of policy definitions designed around a common overarching goal.


20. Built-in vs. Custom Policies

A common exam scenario is deciding whether to use a built-in or custom policy.

RequirementRecommended approach
Microsoft already provides an appropriate policyBuilt-in policy
Organization has unique requirementCustom policy
Need different values for different environmentsParameterized policy
Need many related policies managed togetherInitiative
Need to prevent non-compliant deploymentsDeny
Need visibility without blocking deploymentAudit
Need to automatically change supported propertiesModify
Need to deploy a missing configurationDeployIfNotExists
Need to identify missing related resourcesAuditIfNotExists

21. Policy Compliance

Azure Policy continuously evaluates the compliance state of resources.

A resource can be:

  • Compliant
  • Non-compliant
  • Not registered
  • Conflicting
  • Exempt
  • Unknown, depending on the evaluation circumstances

The important concept for the exam is that Azure Policy isn’t merely a deployment-time mechanism.

It can also evaluate existing resources and report their compliance status.

This makes Azure Policy useful for identifying configuration drift.


22. Remediating Non-Compliant Resources

Some policies don’t simply identify non-compliant resources; they can help remediate them.

The Modify and DeployIfNotExists effects are especially important here.

A remediation workflow generally involves:

  1. Identify non-compliant resources.
  2. Configure the policy appropriately.
  3. Provide an appropriate managed identity.
  4. Grant the identity the required permissions.
  5. Create a remediation task.
  6. Azure Policy performs the required operation.

For custom policies using Modify or DeployIfNotExists, the policy definition can specify the required role definitions through roleDefinitionIds. Permissions should follow least privilege.

Important exam distinction

A policy showing a resource as non-compliant does not automatically mean the resource will be fixed.

The effect and remediation configuration determine whether Azure Policy can take corrective action.


23. Testing Policies Before Enforcement

A good governance strategy is to avoid immediately deploying a new security policy with a disruptive effect such as Deny.

A common approach is:

Phase 1 — Evaluate

Use:

Audit

Determine how many resources would violate the proposed requirement.

Phase 2 — Remediate

Correct existing violations.

Phase 3 — Enforce

Change the policy to an enforcement-oriented effect such as:

Deny

This reduces the likelihood that a new policy unexpectedly breaks production deployments.


24. Policy Enforcement Mode

Azure Policy assignments can also use enforcement behavior that allows organizations to test policy behavior without actually enforcing the effect on new or updated resources.

This is particularly useful during policy development and rollout.

For example, an organization might want to determine whether a Deny policy would interfere with existing deployment processes before fully enforcing it.


25. Azure Policy and Security Governance

Azure Policy is particularly useful for establishing preventive and detective security controls.

Preventive controls

Examples:

  • Deny resources in prohibited regions.
  • Deny insecure resource configurations.
  • Require specific security settings.
  • Prevent certain actions.

Detective controls

Examples:

  • Audit insecure configurations.
  • Identify missing security controls.
  • Report non-compliant resources.
  • Monitor configuration drift.

Corrective controls

Examples:

  • Modify resource properties.
  • Add required tags.
  • Deploy missing configurations.
  • Remediate existing resources.

This makes Azure Policy a useful part of a defense-in-depth security strategy.


26. Azure Policy and Regulatory Compliance

Azure Policy can also support regulatory compliance by enforcing or monitoring required configurations.

For example, an organization might require:

  • Encryption.
  • Secure network connectivity.
  • Diagnostic logging.
  • Approved locations.
  • Resource tagging.
  • Specific security configurations.

Microsoft provides built-in policies and initiatives aligned with various compliance requirements.

However, remember:

Azure Policy helps enforce technical controls; it does not by itself make an organization legally or regulatorily compliant.

Compliance requires the organization to satisfy the complete applicable regulatory framework.


27. Azure Policy Best Practices

1. Prefer built-in policies when appropriate

Don’t create a custom policy when an existing built-in policy already meets the requirement.

2. Use parameters

Parameterized policies are more reusable and reduce policy sprawl.

3. Use initiatives

Group related policies into logical security or governance packages.

4. Start with Audit

For significant new requirements, consider evaluating the impact before enforcing Deny.

5. Use least privilege

Managed identities used for remediation should receive only the permissions they need.

6. Test custom policies

Incorrect policy logic can result in legitimate resources being incorrectly classified or blocked.

7. Understand aliases

When creating custom policies, verify that the property you’re evaluating has the appropriate Azure Policy alias.

8. Monitor compliance

A policy is only useful if you monitor whether resources actually comply.

9. Plan for exceptions

Some workloads legitimately require exceptions. Azure Policy supports policy exemptions for appropriate scenarios.

10. Treat policies as code

For larger organizations, store policy definitions and initiatives in source control and manage them through controlled deployment processes.


28. Important SC-500 Exam Comparisons

These distinctions are worth memorizing.

ConceptPurpose
Azure PolicyEnforce or audit resource configuration and governance
Azure RBACControl who can perform actions on Azure resources
Microsoft Entra IDIdentity and authentication
Resource locksPrevent accidental deletion or modification
Policy definitionDefines the rule
Policy assignmentApplies the rule to a scope
InitiativeGroups multiple policies
Built-in policyMicrosoft-provided policy
Custom policyOrganization-created policy
AuditReport non-compliance
DenyPrevent non-compliant operation
ModifyModify supported resource properties
DeployIfNotExistsDeploy missing configuration/resource
AuditIfNotExistsReport missing configuration/resource
DenyActionBlock specified actions

29. Key Takeaways

For the SC-500 exam, remember these core ideas:

  1. Azure Policy evaluates resource configurations against organizational rules.
  2. A policy definition describes the rule; an assignment applies it.
  3. Built-in policies are maintained by Microsoft.
  4. Custom policies address organization-specific requirements.
  5. Parameters make policies reusable.
  6. Aliases allow policy definitions to reference resource properties.
  7. Audit identifies problems without blocking operations.
  8. Deny prevents non-compliant operations.
  9. Modify changes supported resource properties.
  10. DeployIfNotExists can deploy missing configuration.
  11. AuditIfNotExists detects missing related resources/configuration.
  12. Initiatives group multiple policies into a single governance package.
  13. Policies can be assigned at management group, subscription, resource group, or resource scope.
  14. Remediation can require a managed identity with appropriate permissions.
  15. Least privilege should also apply to policy remediation identities.
  16. Azure Policy can provide preventive, detective, and corrective controls.
  17. Testing with Audit before enforcing Deny can reduce deployment disruption.

10 Practice Exam Questions

Question 1

An organization wants to prevent users from deploying Azure resources outside a predefined set of approved Azure regions.

The organization wants deployments to prohibited regions to be blocked rather than merely reported.

Which Azure Policy effect should you use?

A. Audit

B. Deny

C. Modify

D. AuditIfNotExists

Answer: B

Explanation

The Deny effect prevents resource operations that violate the policy. In this scenario, resources deployed to unapproved regions should be blocked.

  • Audit would report the violation but allow the deployment.
  • Modify is intended to change supported resource properties.
  • AuditIfNotExists is used to identify missing related resources or configurations.

Question 2

Your organization needs a policy that can be assigned to multiple subscriptions. Each subscription must be able to specify its own list of approved Azure regions.

What should you use to make the policy reusable?

A. Policy parameters

B. Resource locks

C. Azure RBAC

D. Policy exemptions

Answer: A

Explanation

Policy parameters allow the same policy definition to be reused with different values during assignment.

For example, the same policy could be assigned to two subscriptions with different allowedLocations parameter values.

Resource locks don’t parameterize policies, RBAC controls authorization, and exemptions are used to exclude resources or scopes from policy enforcement.


Question 3

You need to create a custom Azure Policy that evaluates a specific property of an Azure resource.

What should you determine before writing the policy condition?

A. The resource’s Microsoft Entra group

B. The resource lock level

C. The subscription’s billing administrator

D. The appropriate Azure Policy alias

Answer: D

Explanation

Azure Policy uses property aliases to reference resource properties during policy evaluation.

When developing custom policies, identifying the correct alias is an important step. Azure provides tools for discovering available aliases.


Question 4

An organization wants to determine which existing resources violate a new security requirement. The organization does not want to prevent deployments while it evaluates the impact of the requirement.

Which effect should be used?

A. Deny

B. DeployIfNotExists

C. Modify

D. Audit

Answer: D

Explanation

Audit identifies non-compliant resources without blocking their deployment or modification.

This is commonly useful when introducing a new policy and determining the current compliance baseline before moving to stronger enforcement.


Question 5

A company requires every Azure resource to contain a CostCenter tag. When the tag is missing, Azure Policy should automatically add the tag.

Which policy effect is most appropriate?

A. AuditIfNotExists

B. Modify

C. DenyAction

D. Audit

Answer: B

Explanation

The Modify effect can add, update, or remove supported resource properties, including tags.

A policy using Modify can therefore add a required tag when appropriate.

Audit would only report the problem, while AuditIfNotExists is designed to evaluate whether a related resource or configuration exists.


Question 6

An organization wants to apply 15 different security policies as a single logical security baseline.

What should the organization create?

A. Resource lock

B. Policy assignment

C. Initiative

D. Custom RBAC role

Answer: C

Explanation

An initiative, also called a policy set, groups multiple policy definitions into a single logical collection.

The initiative can then be assigned as a unit.


Question 7

A company wants to determine whether virtual machines have a required related monitoring configuration. If the configuration is missing, the company only wants Azure Policy to report the VM as non-compliant.

Which effect should be used?

A. AuditIfNotExists

B. Modify

C. DeployIfNotExists

D. Deny

Answer: A

Explanation

AuditIfNotExists checks whether a related resource or configuration exists and reports non-compliance when it doesn’t.

DeployIfNotExists would go further by attempting to deploy the missing configuration.


Question 8

An organization wants Azure Policy to automatically deploy a required configuration when that configuration doesn’t exist on a resource.

Which effect should be used?

A. Audit

B. Deny

C. DeployIfNotExists

D. Disabled

Answer: C

Explanation

DeployIfNotExists can deploy a related resource or configuration when the required item doesn’t exist.

This effect can be used for corrective enforcement rather than simply reporting a compliance problem.


Question 9

A custom policy uses the DeployIfNotExists effect. Azure Policy must deploy resources as part of remediation.

What additional security consideration is required?

A. A resource lock must be applied to every target resource

B. A managed identity must have the required permissions

C. Every user must be assigned Owner

D. Microsoft Entra Password Hash Synchronization must be enabled

Answer: B

Explanation

Policies that perform remediation using DeployIfNotExists require an appropriate managed identity and sufficient permissions.

The permissions should follow the principle of least privilege. The identity should not automatically be granted broad permissions such as Owner unless they are genuinely required.


Question 10

An organization has several subscriptions under a management group. The security team wants one policy to enforce the same security requirement across all applicable subscriptions.

Where is an appropriate place to assign the policy?

A. The management group

B. Each individual VM

C. Each individual resource group only

D. The Microsoft Entra tenant

Answer: A

Explanation

A policy assigned at the management-group scope can apply to resources in child management groups and subscriptions within that hierarchy.

This is an effective approach for centralized governance across multiple subscriptions.

The Microsoft Entra tenant is not an Azure Policy assignment scope.


Final Exam-Focused Summary

If you remember only one conceptual model from this topic, remember:

                 AZURE POLICY
                      │
             ┌────────┴────────┐
             │                 │
       Policy Definition    Assignment
             │                 │
             │             Applies to scope
             │                 │
             └────────┬────────┘
                      │
                  Evaluation
                      │
          ┌───────────┼────────────┐
          │           │            │
        Audit       Deny        Remediate
                                  │
                         ┌────────┴────────┐
                         │                 │
                      Modify       DeployIfNotExists

And the most important exam distinctions are:

Definition = what the rule says

Assignment = where the rule applies

Parameter = makes the rule reusable

Alias = identifies the resource property

Audit = identify the problem

Deny = prevent the problem

Modify = change the resource

DeployIfNotExists = deploy what’s missing

Initiative = group policies together

Managed identity = enables policy remediation when permissions are required

These distinctions are particularly useful because SC-500 questions can present very similar scenarios where the key is identifying whether the requirement is to detect, prevent, modify, or deploy a security configuration.


Go to the SC-500 Exam Prep Hub main page

Evaluate regulatory compliance by using Microsoft Defender for Cloud (SC-500 Exam Prep)

This post is a part of the "SC-500: Implementing End-to-End Security Controls for Cloud and AI Workloads" Exam Prep Hub.
This topic falls under these sections:
Manage identity, access, and governance (20–25%)
   --> Implement governance to enforce security and regulatory compliance
      --> Evaluate regulatory compliance by using Microsoft Defender for Cloud


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Overview

Organizations operating in the cloud are often required to demonstrate compliance with regulatory, industry, and organizational security requirements. Examples include PCI DSS, ISO 27001, NIST, CIS benchmarks, FedRAMP, and other regulatory frameworks.

Microsoft Defender for Cloud provides a Regulatory compliance capability that helps security teams continuously assess their cloud environments against supported security and compliance standards.

Rather than manually reviewing every Azure resource against a regulatory framework, Defender for Cloud maps security requirements to security controls and assessments. It then identifies resources that do not satisfy those controls and provides recommendations for improving compliance.

For the SC-500 exam, it is important to understand the relationship between:

Standards → Controls → Assessments → Recommendations → Remediation → Compliance posture

Defender for Cloud continuously evaluates supported resources and presents the results through the Regulatory compliance dashboard.


1. What Is Regulatory Compliance in Defender for Cloud?

The Regulatory compliance capability in Microsoft Defender for Cloud allows an organization to evaluate its cloud resources against selected security and regulatory standards.

The dashboard provides visibility into:

  • Which compliance standards are enabled
  • Which subscriptions or cloud environments the standards apply to
  • The controls associated with each standard
  • Which assessments are passing or failing
  • Which resources are affected
  • Recommendations for addressing failed assessments
  • Manual assessments that require customer attestation
  • Overall compliance progress

Defender for Cloud can assess Azure resources and, when the appropriate multicloud integrations are configured, resources in AWS and Google Cloud Platform (GCP) as well.

Important distinction

Defender for Cloud helps an organization assess and improve its technical compliance posture. It does not automatically certify an organization as legally or regulatory compliant.

For example, if Defender for Cloud reports that all applicable Azure resources satisfy the technical controls associated with a PCI DSS standard, that does not by itself mean the organization has obtained PCI DSS certification.

Compliance frequently includes organizational processes, documentation, policies, personnel procedures, physical controls, and other requirements that cannot necessarily be validated automatically.


2. The Compliance Hierarchy

One of the most important concepts to understand is how Defender for Cloud organizes compliance information.

A useful way to visualize it is:

Compliance Standard
│
├── Control 1
│ ├── Assessment A
│ └── Assessment B
│
├── Control 2
│ ├── Assessment C
│ └── Assessment D
│
└── Control 3
├── Assessment E
└── Assessment F

Standard

A standard represents a security benchmark or regulatory framework against which resources are evaluated.

Examples can include:

  • Microsoft Cloud Security Benchmark (MCSB)
  • CIS benchmarks
  • ISO 27001
  • NIST-related standards
  • PCI DSS
  • FedRAMP

The exact standards available depend on the environment, cloud provider, Defender for Cloud configuration, and applicable plans.

Control

A control represents a particular security requirement within a standard.

For example, a standard might contain controls concerning:

  • Identity and access management
  • Network security
  • Data protection
  • Encryption
  • Logging
  • Vulnerability management

Assessment

An assessment evaluates whether a particular resource or configuration satisfies the requirement represented by a control.

An assessment can identify:

  • Passing resources
  • Failing resources
  • The affected resource type
  • Remediation guidance

Recommendation

When an assessment identifies a security problem, Defender for Cloud can generate a security recommendation describing what should be changed.

This relationship is critical for exam questions:

A control is a requirement. An assessment evaluates compliance with that requirement. A recommendation tells you how to address an identified problem.

Defender for Cloud uses assessments against security standards to generate actionable recommendations.


3. Microsoft Cloud Security Benchmark

The Microsoft Cloud Security Benchmark (MCSB) is Microsoft’s cloud security baseline.

It provides security recommendations across areas such as:

  • Network security
  • Identity management
  • Privileged access
  • Data protection
  • Logging and monitoring
  • Incident response
  • Vulnerability management
  • Endpoint security

The MCSB is an important baseline in Defender for Cloud.

For Azure environments, the Microsoft Cloud Security Benchmark is enabled by default as a foundational security benchmark. Other compliance standards can be added when appropriate Defender for Cloud capabilities are enabled.

Exam tip

Don’t confuse the MCSB with a specific regulatory certification.

The MCSB is a Microsoft security benchmark/baseline. Regulatory standards such as PCI DSS and ISO 27001 represent external frameworks or compliance requirements.


4. Regulatory Compliance Dashboard

The Regulatory compliance dashboard is the primary interface for reviewing compliance posture.

From the dashboard, security administrators can:

  1. Select a compliance standard.
  2. Review its controls.
  3. Expand controls to see associated assessments.
  4. Identify passing and failing assessments.
  5. View affected resources.
  6. Review remediation recommendations.
  7. Review manual assessments.
  8. Track compliance over time.

The dashboard is therefore useful for both technical security teams and compliance/audit stakeholders.


5. Understanding Compliance Scores

Defender for Cloud uses assessment results to help organizations understand their compliance posture.

A failed assessment generally means that one or more resources do not satisfy the security requirement represented by that assessment.

For example:

ISO 27001
│
└── Access Control
│
└── Assessment:
Privileged accounts must use MFA
│
├── 95 resources compliant
└── 5 resources noncompliant

The five noncompliant resources become candidates for investigation and remediation.

As security issues are corrected and assessments subsequently pass, the organization’s compliance posture improves.

Important timing consideration

Assessment results are not necessarily updated instantly after every configuration change. Microsoft documentation currently indicates that many Defender for Cloud assessments run approximately every 12 hours. Therefore, correcting a resource does not necessarily cause the dashboard to immediately reflect the change.

Exam scenario

If an administrator fixes a failing configuration but immediately checks the Regulatory compliance dashboard and still sees the resource as noncompliant, the correct explanation may simply be that the assessment has not run again yet.


6. Assigning Regulatory Compliance Standards

Organizations can choose which regulatory standards they want to track.

The general process is:

  1. Open Microsoft Defender for Cloud.
  2. Open Regulatory compliance.
  3. Select Manage compliance policies.
  4. Select the appropriate scope.
  5. Open Security policies.
  6. Locate the desired standard.
  7. Turn the standard On.
  8. Configure any required parameters.

The standard is then applied to the selected scope and Defender for Cloud begins assessing applicable resources.


7. Choosing the Correct Scope

Compliance standards can be assigned at appropriate management scopes.

For Azure, this can include scopes such as:

  • Subscription
  • Management group

For multicloud environments, Defender for Cloud also supports applicable AWS and GCP scopes.

Best practice

When possible, assign a compliance standard at the highest appropriate scope.

For example, if an organization wants the same standard applied consistently across many subscriptions within a management group, assigning it at the management-group level can simplify centralized governance.

The resulting compliance information can then be aggregated across the applicable resources.


8. Compliance Standards Use Azure Policy

A particularly important SC-500 concept is the relationship between Defender for Cloud regulatory compliance standards and Azure Policy.

For Azure environments, regulatory compliance standards use Azure Policy initiatives to represent the controls and assessment logic used to evaluate resources.

This means Azure Policy provides much of the underlying evaluation mechanism.

Conceptually:

Regulatory Standard
↓
Azure Policy Initiative
↓
Policy Definitions
↓
Resource Evaluation
↓
Compliance Assessment
↓
Defender for Cloud Dashboard

This is why Azure Policy and Defender for Cloud frequently appear together in security and governance exam questions.

Key distinction

Azure Policy is primarily the governance and compliance enforcement/evaluation mechanism.

Defender for Cloud provides a broader security posture and compliance-management experience, including:

  • Security recommendations
  • Compliance dashboards
  • Regulatory standards
  • Security posture information
  • Remediation guidance
  • Reporting

9. Automated vs. Manual Assessments

Not every regulatory requirement can be evaluated automatically.

Defender for Cloud therefore supports both automated assessments and manual assessments.

Automated assessments

An automated assessment can evaluate technical characteristics of resources.

For example:

Are storage resources configured according to the required security configuration?

The assessment can inspect the relevant resource configuration and determine whether it passes or fails.

If it fails, Defender for Cloud can identify the affected resources and provide remediation information.


Manual assessments

Some compliance requirements depend on organizational processes or evidence that cannot be determined solely from Azure resource configuration.

For example, an organization may need to demonstrate that:

  • Employees receive security training.
  • A documented incident-response process exists.
  • A particular organizational procedure is performed.
  • An administrative process has been reviewed.

These requirements may appear as manual assessments.

An authorized person can provide an attestation and attach supporting evidence.

The Regulatory compliance dashboard supports manual attestation and evidence for applicable assessments.

Exam tip

If a question describes a compliance requirement that cannot be determined from resource configuration, think:

Manual assessment / attestation

rather than trying to solve the problem with an Azure Policy that cannot actually evaluate the requirement.


10. Investigating Failed Assessments

When a compliance control is failing, the recommended workflow is generally:

Regulatory compliance
↓
Select standard
↓
Select control
↓
Review assessment
↓
Identify affected resources
↓
Review recommendation
↓
Remediate
↓
Assessment runs again
↓
Compliance status updated

The dashboard allows security teams to drill down from the standard to the control, then to the assessment and affected resources.

This is much more useful than simply knowing that an organization has a low compliance score.

The goal is to identify why the organization is failing and which resources need remediation.


11. Remediating Automated Assessments

For automated assessments, Defender for Cloud typically provides remediation guidance associated with the failed recommendation.

A common workflow is:

  1. Open the Regulatory compliance dashboard.
  2. Select the relevant standard.
  3. Select the failing control.
  4. Select the failed assessment.
  5. Review the affected resources.
  6. Review the recommendation.
  7. Follow the remediation guidance.
  8. Correct the resource configuration.
  9. Wait for the assessment to run again.
  10. Verify the updated compliance status.

Depending on the recommendation, remediation may be performed manually or through supported automated mechanisms.


12. Manual Attestation and Evidence

Manual assessments require a different workflow.

An authorized user can:

  1. Open the relevant regulatory compliance standard.
  2. Select the control.
  3. Locate the manual assessment.
  4. Select the applicable subscription.
  5. Select Attest.
  6. Provide the required information.
  7. Attach supporting evidence.
  8. Save the attestation.

This allows the organization to document compliance for requirements that cannot be validated automatically.

Important exam distinction

Automated assessment

Defender for Cloud evaluates the resource.

Manual assessment

A person provides an attestation and supporting evidence.


13. Compliance Reports

Defender for Cloud can generate compliance reports that summarize the organization’s status against a selected standard.

These reports can be useful for:

  • Security leadership
  • Compliance teams
  • Internal auditors
  • External auditors
  • Governance teams
  • Risk management teams

A compliance report can provide a snapshot of the organization’s status based on Defender for Cloud assessment data.

Defender for Cloud also provides access to applicable audit/certification reports for Microsoft services.

Important distinction

There are two different concepts:

Your organization’s compliance status

versus

Microsoft’s own service certifications and attestations.

Do not confuse an Azure service’s certification with your organization’s compliance posture.


14. Continuous Export of Compliance Data

Organizations may need to integrate compliance information with other systems.

Defender for Cloud supports mechanisms for continuously exporting compliance status so that compliance information can be consumed outside the Defender for Cloud portal.

This can be useful when organizations need centralized reporting or integration with broader security and governance processes.


15. Automating Responses to Compliance Changes

Defender for Cloud can integrate compliance events with Azure Logic Apps through workflow automation.

For example:

Compliance assessment changes
↓
Defender for Cloud workflow automation
↓
Azure Logic App
↓
Notification / ticket / remediation workflow

A company might configure a workflow that sends an email or initiates an operational process whenever a compliance assessment changes state.

Defender for Cloud workflow automation can trigger Logic Apps based on changes involving regulatory compliance assessments.

Example

An organization requires notification whenever a critical compliance assessment fails.

The solution could be:

Defender for Cloud → Workflow automation → Logic App → Notification


16. Compliance Across Multicloud Environments

Defender for Cloud can provide compliance visibility beyond Azure when AWS and GCP environments are connected.

This can help organizations establish a centralized view of security and compliance posture across:

  • Azure
  • AWS
  • GCP

Supported standards vary by cloud provider.

For example, Defender for Cloud provides cloud-specific benchmarks and supports various regulatory standards across supported environments.

Exam consideration

If the question asks for a centralized security posture and compliance view across Azure, AWS, and GCP, Microsoft Defender for Cloud is a strong candidate.


17. Why Some Controls May Be Grayed Out

A compliance standard can contain controls that Defender for Cloud cannot automatically evaluate.

A control may appear unavailable or grayed out when there is no applicable Defender for Cloud assessment associated with it.

Possible reasons include:

  • The control is procedural.
  • The control requires organizational evidence.
  • No automated assessment currently exists.
  • The control isn’t applicable to the resources being evaluated.

Therefore:

A grayed-out control does not necessarily mean that the organization is noncompliant.

It may mean Defender for Cloud cannot perform an automated assessment for that particular requirement.


18. Custom Standards and Assessments

Organizations sometimes have security requirements that aren’t represented adequately by the built-in standards.

Defender for Cloud supports custom standards and recommendations.

Custom standards can allow an organization to represent its own security requirements and combine relevant recommendations into an organizational standard.

Microsoft’s current Defender for Cloud capabilities also support custom recommendations using KQL when the appropriate CSPM capabilities are enabled.

Important current-state consideration

Older documentation describes creating custom Defender for Cloud recommendations and standards through Azure Policy definitions and initiatives. Microsoft now identifies that approach as a legacy feature and recommends the newer custom recommendation capabilities for new implementations.

For the SC-500 exam, however, you should still understand the fundamental relationship between Azure Policy initiatives, compliance standards, assessments, and Defender for Cloud.


19. Defender for Cloud vs. Azure Policy

These services work together but serve different purposes.

CapabilityAzure PolicyDefender for Cloud
Evaluate resource configurationYesYes
Governance policiesYesUses policy-based assessments
Regulatory compliance dashboardNoYes
Security recommendationsLimited/direct policy resultsYes
Secure ScoreNoYes
Regulatory standardsPolicy initiatives can represent controlsYes
Threat protectionNoYes
Security posture managementLimitedYes
Manual compliance attestationNoYes
Compliance reportingPolicy compliance reportsYes
Workflow automationPolicy automation optionsYes

Remember

A useful way to think about them is:

Azure Policy governs resource configuration. Defender for Cloud evaluates and communicates security posture and compliance across your cloud environment.


20. Defender for Cloud vs. Microsoft Purview Compliance Manager

These services can also complement one another.

Microsoft Defender for Cloud focuses heavily on the security posture and technical configuration of cloud resources.

Microsoft Purview Compliance Manager provides broader compliance-management capabilities, including assessments and improvement actions across supported Microsoft compliance scenarios.

Defender for Cloud compliance information can integrate with Purview Compliance Manager for supported standards and environments.

Exam strategy

When a question focuses on:

  • Azure resource configuration
  • Security recommendations
  • Cloud security posture
  • Technical security controls
  • Azure/AWS/GCP resources

think Defender for Cloud.

When the question focuses more broadly on:

  • Organizational compliance management
  • Microsoft 365 compliance
  • Compliance improvement actions
  • Regulatory assessment management

consider Microsoft Purview Compliance Manager.


21. Common SC-500 Exam Scenarios

Scenario 1: Identify failing compliance controls

An administrator needs to determine which controls in an ISO standard are failing.

Solution: Use the Regulatory compliance dashboard in Defender for Cloud.


Scenario 2: Determine which resources are causing a failed control

A compliance control is failing, and the security team needs to identify the affected resources.

Solution: Expand the control and assessment in the Regulatory compliance dashboard.


Scenario 3: Correct an automated compliance failure

A VM fails an assessment because its configuration doesn’t satisfy a security requirement.

Solution: Review the associated Defender for Cloud recommendation and remediate the affected resource.


Scenario 4: Document a procedural requirement

A compliance requirement requires evidence of an organizational process that Defender for Cloud cannot automatically verify.

Solution: Use a manual assessment and attestation, including supporting evidence.


Scenario 5: Notify administrators when compliance changes

The organization wants to send an email whenever a compliance assessment changes state.

Solution: Use Defender for Cloud workflow automation with an Azure Logic App.


Scenario 6: Apply a standard to multiple subscriptions

An organization wants to manage a compliance standard consistently across multiple subscriptions.

Solution: Assign the standard at the appropriate management-group scope when applicable.


22. Key Concepts to Remember for the Exam

The following concepts are especially important:

Regulatory compliance dashboard

The primary interface for viewing and investigating compliance against enabled standards.

Standard

A framework or benchmark containing security requirements.

Control

A specific requirement within a standard.

Assessment

An evaluation that determines whether a resource satisfies a control.

Recommendation

An actionable security finding that helps remediate a failed assessment.

Automated assessment

A technical assessment performed automatically against applicable resources.

Manual assessment

A compliance requirement requiring human attestation and potentially supporting evidence.

MCSB

Microsoft’s foundational cloud security benchmark.

Azure Policy

Provides policy definitions and initiatives that underpin many Azure compliance evaluations.

Compliance scope

The subscriptions or other supported cloud scopes to which a standard is assigned.

Compliance report

A report summarizing compliance status against a selected standard.

Workflow automation

Can trigger Azure Logic Apps when relevant Defender for Cloud security or compliance events occur.

Assessment timing

Compliance data may not update immediately after remediation because assessments run on a schedule.


23. Exam-Day Mental Model

When you see a question involving regulatory compliance in Defender for Cloud, think through this sequence:

What standard?
↓
What control?
↓
What assessment?
↓
Which resources failed?
↓
What recommendation?
↓
How is it remediated?
↓
Does it require manual attestation?
↓
Does the organization need reporting?
↓
Does the organization need automation?

And remember these core relationships:

Standard = What requirements are we measuring against?

Control = What specific requirement are we evaluating?

Assessment = Does the environment satisfy the requirement?

Recommendation = What should we do about a failure?

Attestation = How do we document a requirement that can’t be automatically evaluated?

Compliance dashboard = Where do we view and investigate the results?


Practice Exam Questions

Question 1

A security administrator needs to determine which resources are causing a compliance control to fail for an organization’s selected regulatory standard.

Where should the administrator begin?

A. Microsoft Defender for Cloud Regulatory compliance dashboard

B. Microsoft Entra ID Protection

C. Azure Monitor Metrics

D. Microsoft Sentinel Analytics rules

Answer: A

Explanation

The Regulatory compliance dashboard is designed to allow administrators to select a standard, expand its controls, review assessments, and identify affected resources. Defender for Cloud also provides remediation information for failed assessments.

The other options serve different purposes. Entra ID Protection focuses on identity risks, Azure Monitor Metrics focuses on monitoring metrics, and Sentinel analytics rules detect security events and threats.


Question 2

An organization enables a compliance standard in Microsoft Defender for Cloud. A security administrator wants to understand the relationship between the requirements in the standard and the resources being evaluated.

Which component represents a specific requirement within the compliance standard?

A. Control

B. Recommendation

C. Subscription

D. Workflow

Answer: A

Explanation

A control represents a specific security or compliance requirement within a standard.

The hierarchy is:

Standard → Control → Assessment → Resource

A recommendation is generated to help address an identified security issue; it isn’t the requirement itself.


Question 3

A company has a compliance requirement stating that administrators must complete annual security training. Defender for Cloud cannot determine automatically whether all employees completed the training.

What should the security team use to document compliance?

A. Azure Policy deny effect

B. Automated assessment

C. Manual assessment and attestation

D. Azure Firewall policy

Answer: C

Explanation

Requirements that cannot be evaluated automatically from resource configuration can be handled using manual assessments. An authorized user can attest to compliance and provide supporting evidence.

An Azure Policy rule cannot automatically determine whether employees completed an organizational training program.


Question 4

An organization corrects a configuration issue identified by a Defender for Cloud compliance assessment. Immediately afterward, the Regulatory compliance dashboard still shows the resource as noncompliant.

What is the most likely explanation?

A. Regulatory compliance cannot detect configuration changes

B. The relevant assessment has not run again yet

C. Defender for Cloud only evaluates resources once per year

D. The compliance standard must be deleted and reassigned

Answer: B

Explanation

Defender for Cloud assessments run periodically rather than necessarily updating the compliance dashboard immediately after every configuration change. Current Microsoft documentation indicates that many assessments run approximately every 12 hours.

Therefore, after remediation, the administrator may need to wait for the next assessment cycle before the compliance status changes.


Question 5

An organization wants to apply a regulatory compliance standard to all appropriate Azure subscriptions within a management group.

Which approach is generally most appropriate?

A. Assign the standard at the appropriate management-group scope

B. Create a separate Microsoft Sentinel workspace for every subscription

C. Configure the standard only on individual virtual machines

D. Assign the standard through Microsoft Entra Conditional Access

Answer: A

Explanation

Applying a standard at the highest appropriate management scope can simplify centralized governance across nested Azure resources and subscriptions.

Conditional Access manages identity access policies, Sentinel manages security analytics, and individual VM configuration is too narrow for centralized regulatory governance.


Question 6

A compliance team wants to automatically notify a security operations team whenever a Defender for Cloud regulatory compliance assessment changes state.

Which solution should be used?

A. Azure Resource Graph only

B. Defender for Cloud workflow automation with an Azure Logic App

C. Microsoft Entra password protection

D. Azure Bastion

Answer: B

Explanation

Defender for Cloud workflow automation can trigger Azure Logic Apps based on supported security and regulatory compliance events.

A Logic App can then perform actions such as sending notifications, creating operational workflows, or initiating additional remediation processes.


Question 7

A security administrator wants to understand what remediation action should be taken for a resource that failed a regulatory compliance assessment.

Which Defender for Cloud capability provides this information?

A. Microsoft Defender XDR incidents

B. Azure Service Health

C. Security recommendation associated with the failed assessment

D. Microsoft Entra audit logs

Answer: C

Explanation

Defender for Cloud security recommendations provide actionable information about security issues, affected resources, and remediation steps.

The recommendation is the bridge between identifying a failed assessment and determining what should be done to address it.


Question 8

Which statement best describes the relationship between regulatory compliance standards in Defender for Cloud and Azure Policy?

A. Defender for Cloud completely replaces Azure Policy

B. Azure Policy is used only for Microsoft Entra configurations

C. Azure Policy cannot participate in compliance assessments

D. Regulatory compliance standards for Azure use Azure Policy initiatives to represent controls and assessment logic

Answer: D

Explanation

For Azure environments, Defender for Cloud regulatory compliance standards use Azure Policy initiatives. The initiatives contain policy definitions that provide the underlying evaluation logic for applicable controls.

This relationship is important for SC-500 questions involving both Azure Policy and Defender for Cloud.


Question 9

An auditor requests a report showing the organization’s current compliance status against a selected regulatory standard.

Which Defender for Cloud capability should the security team use?

A. Download report from the Regulatory compliance dashboard

B. Azure VM Run Command

C. Microsoft Entra ID Protection workbook

D. Azure Network Watcher

Answer: A

Explanation

Defender for Cloud’s Regulatory compliance dashboard provides the ability to generate compliance reports for selected standards. These reports summarize compliance status based on Defender for Cloud assessment data and can be shared with relevant stakeholders.

The other services do not provide this regulatory compliance reporting capability.


Question 10

A compliance standard contains a control that appears unavailable in the Defender for Cloud dashboard. The control has no associated automated assessment.

What is the most appropriate interpretation?

A. All resources associated with the control are automatically noncompliant

B. Defender for Cloud has automatically disabled the subscription

C. The control may require a manual process or may not currently have an applicable automated assessment

D. The organization must immediately purchase Microsoft Sentinel

Answer: C

Explanation

Some compliance controls cannot be automatically evaluated by Defender for Cloud. They may involve procedural requirements, require manual evidence, or simply lack an applicable automated assessment.

A control without an automated assessment should not automatically be interpreted as a failed technical configuration.


Final Exam Takeaways

For “Evaluate regulatory compliance by using Microsoft Defender for Cloud,” focus on mastering these distinctions:

ConceptWhat to Remember
Regulatory complianceContinuously evaluates cloud resources against selected standards
StandardDefines a framework or benchmark
ControlRepresents an individual requirement within a standard
AssessmentEvaluates whether resources satisfy a control
RecommendationProvides actionable remediation guidance
MCSBMicrosoft’s foundational cloud security benchmark
Automated assessmentEvaluates technical resource configurations
Manual assessmentRequires human attestation/evidence
Regulatory compliance dashboardCentral place to investigate compliance
Azure PolicyProvides policy initiatives/definitions used for Azure compliance evaluation
Compliance reportsCommunicate compliance status to stakeholders
Workflow automationCan trigger Logic Apps when compliance assessments change
Assessment timingResults may take time to reflect remediation
MulticloudDefender for Cloud can provide compliance visibility across supported Azure, AWS, and GCP environments

The biggest exam trap is confusing a standard, control, assessment, and recommendation. If you can consistently distinguish those four, a significant portion of scenario-based questions on this topic becomes much easier.


Go to the SC-500 Exam Prep Hub main page

Creating an Ontology in Microsoft Fabric

What Is an Ontology in Microsoft Fabric?

An ontology provides a formal definition of business concepts, their properties, and the relationships between them. In a modern data platform, it helps connect technical data assets to business meaning, making information easier for analysts, applications, and AI systems to interpret.

In Microsoft Fabric, it is important to distinguish between building an ontology as a conceptual design and implementing it using Fabric’s data and semantic capabilities. A Power BI semantic model, for example, can define business entities, relationships, measures, and terminology, but it is not automatically a formal ontology.

Fabric provides the data engineering, analytics, and semantic modeling capabilities that can serve as the foundation for an ontology-driven solution.

Steps to Create an Ontology in Microsoft Fabric

Microsoft Fabric now includes an Ontology (preview) item that lets you define business entities, properties, relationships, and bindings to underlying data. You can create one from an existing semantic model or build it directly from data in OneLake.

Tutorial Part 0: Introduction and Environment Setup - Microsoft Fabric | Microsoft Learn

(from Microsoft Learn)

1. Prepare your data

Organize relevant business data in a Fabric lakehouse or create a Power BI semantic model with appropriate tables, columns, relationships, and measures.

Microsoft Fabric October & November 2025 Update | element61

(from Microsoft Learn)

2. Create the ontology

To reuse an existing semantic model, open its overview page and select Generate Ontology. Alternatively, select + New item in your workspace and choose Ontology (preview) to build one from scratch.

Tutorial part 3: Preview the ontology - Microsoft Fabric | Microsoft Learn

(from Microsoft Learn)

3. Define entities and relationships

Create business entities such as Customer, Product, Store, and Sale. Define their properties, select appropriate entity keys, and establish relationships such as a Customer placing an Order.

Add Relationship Types - Microsoft Fabric | Microsoft Learn

(from Microsoft Learn)

4. Bind the ontology to your data

Map entity properties and relationships to the appropriate source tables and columns. This connects business definitions to actual enterprise data without requiring the ontology to duplicate that data.

Use preview experience - Microsoft Fabric | Microsoft Learn

(from Microsoft Learn)

5. Validate and use the ontology

Verify entity keys, property mappings, and relationships. You can then explore connected data through supported ontology experiences, including graph visualization and natural-language queries using Fabric data agent capabilities.

Example: A Retail Ontology

A retailer could define the following business relationships:

Customer

places

Sale / Order

contains

Product

belongs to

Product Category

With the relationships and data bindings configured, an AI-powered experience could use this shared business context to help answer questions such as, “Which customers purchased products in our premium category?”

Important Considerations

  • Preview status: As of October 2026, Fabric’s Ontology item is in preview, so capabilities and user interfaces may change.
  • Permissions and capacity: Check that your tenant has ontology functionality enabled, your workspace uses a supported Fabric capacity, and you have the required workspace and semantic model permissions.
  • Quality matters: Review generated entities and relationships rather than assuming the automatically created ontology is complete.
  • Start with business meaning: Agree on entity definitions, identifiers, and relationships before expanding the ontology across multiple data domains.

Conclusion

Creating an ontology in Microsoft Fabric helps organizations move beyond storing and reporting data toward representing the meaning of their business information. By building on existing semantic models or binding directly to OneLake data, organizations can create a reusable business context that supports connected analytics and AI applications.

Checkout the official, complete walkthrough on Microsoft Learn … https://learn.microsoft.com/en-us/fabric/iq/ontology/tutorial-1-create-ontology

.

Understanding Ontologies in Data: Connecting Data to Meaning

This is a quick article that describes what an ontology is and why ontologies are important.

What is an Ontology?

In data management, an ontology is a formal representation of knowledge that defines the concepts within a particular domain, their properties, and the relationships between them. It provides a shared understanding of what data means, how different entities relate to one another, and how systems can interpret those relationships consistently.

While a database schema defines how data is structured and stored, an ontology goes a step further by describing the meaning of the data and the rules governing its relationships.

What does an Ontology consist of?

An ontology typically consists of four key elements:

  • Entities or concepts: The things being described, such as Customers, Products, Orders, and Employees.
  • Properties: The characteristics of those concepts, such as a customer’s name, a product’s price, or an employee’s department.
  • Relationships: How concepts connect to one another, such as a Customer placing an Order or an Employee managing a Department.
  • Rules and constraints: Conditions that define how concepts behave or relate, such as an Order containing at least one Product.

Consider a retail business. Its ontology might define that a Customer places an Order, an Order contains Products, and each Product belongs to a Product Category. These relationships help systems understand the business beyond individual database tables.

Ontology vs. Data Model vs. Semantic Model vs. Knowledge Graph

Although these concepts are related, they serve different purposes.

ConceptPrimary PurposeExample
Data ModelDefines the structure and organization of data.Customer and Order tables connected by a foreign key.
OntologyDefines concepts, meanings, relationships, and rules within a domain.A customer places an order, which contains products.
Semantic ModelOrganizes data around business concepts, relationships, measures, and definitions to support consistent analysis and reporting.A Power BI model connecting Customers, Products, and Sales, with a standardized Total Revenue measure.
Knowledge GraphRepresents entities and their relationships as connected data.A graph showing customers, orders, products, and their connections.

An ontology can provide the semantic foundation for a knowledge graph, while a data model defines how information is organized in a particular system. A semantic model builds on data structures and business definitions to make information easier to query, analyze, and interpret consistently.

For example, a Power BI semantic model may define a standardized Revenue measure, establish relationships between sales and product tables, and organize fields into user-friendly business categories. An ontology could extend this understanding by formally defining what a Customer or Product represents and how those concepts relate across multiple business systems.

Why are Ontologies important?

Ontologies are increasingly valuable in modern data environments because they help organizations:

  1. Improve data integration: Connect information across systems that use different structures or terminology.
  2. Establish consistent business definitions: Ensure that concepts such as Customer, Revenue, or Active Account have a shared meaning.
  3. Enable semantic search: Allow users and applications to find information based on meaning and relationships rather than just matching keywords.
  4. Support artificial intelligence: Give AI systems structured domain knowledge that can help them interpret questions, identify relationships, and produce more contextually relevant responses.
  5. Improve data discovery: Help analysts and business users understand how datasets and business concepts relate to one another.

For example, an AI assistant answering the question, “Which customers purchased products in our premium category?” could use an ontology to understand the relationships between customers, purchases, products, and product categories—even when the underlying information is distributed across multiple systems.

Ontologies and the future of data

As organizations adopt knowledge graphs, semantic models, and AI-powered applications, ontologies are becoming an important component of data architecture. They help bridge the gap between raw data and business meaning, allowing both people and machines to interpret information more consistently.

The key takeaway: A data model explains how data is organized, an ontology explains what the data represents and how its concepts relate, a semantic model makes data meaningful and usable for business analysis, and a knowledge graph represents entities and their relationships as connected information. Together, these concepts help organizations build more connected, intelligent, and AI-ready data environments.

Thanks for reading!

Exam Prep Hub for AI-200: Developing AI Cloud Solutions on Azure

Welcome to the AI-200: Developing AI Cloud Solutions on Azure Exam Prep Hub!

Welcome to the one-stop hub with information for preparing for the AI-200: Developing AI Cloud Solutions on Azure certification exam. The content for this exam helps prepare you to be “responsible for contributing to all phases of implementing AI solutions on Azure, with an emphasis on back-end services and components. You’re also responsible for supporting all phases of the development lifecycle, including requirements gathering, design, development, deployment, security, and monitoring”.
Upon successful completion of the exam, you earn the Microsoft Certified: Azure AI Cloud Developer Associate certification.

This hub provides information directly here (topic-by-topic as outlined in the official study guide), links to a number of external resources, tips for preparing for the exam, practice tests, and section questions to help you prepare. Bookmark this page and use it as a guide to ensure that you are fully covering all relevant topics for the AI-200 exam and making use of as many of the resources available as possible.


Audience Profile (from Microsoft’s site)

As a candidate for this Microsoft Certification, you’re responsible for contributing to all phases of implementing AI solutions on Azure, with an emphasis on back-end services and components. You’re also responsible for supporting all phases of the development lifecycle, including requirements gathering, design, development, deployment, security, and monitoring.
You should be proficient in:
- Azure SDKs and third-party SDKs used in Azure.
- Azure data management services.
- Azure monitoring and troubleshooting.
- Azure messaging and eventing.
- Vector databases.
- Python programming.
- Implementing containerized applications on Azure.

Skills at a glance (as specified in the official study guide)

  • Develop containerized solutions on Azure (20–25%)
  • Develop AI solutions by using Azure data management services (25–30%)
  • Connect to and consume Azure services (20–25%)
  • Secure, monitor, troubleshoot Azure solutions (20–25%)

Topic-by-Topic Exam Content

[click a topic link to access the content and practice questions for that topic]

Develop containerized solutions on Azure (20–25%)

Implement container application hosting

Implement container-orchestrated solutions

Develop AI solutions by using Azure data management services (25–30%)

Develop AI solutions by using Azure Cosmos DB for NoSQL

Develop AI solutions by using Azure Database for PostgreSQL

Integrate Azure Managed Redis in AI solutions

Connect to and consume Azure services (20–25%)

Develop event- and message-based AI solutions

Develop and implement Azure Functions

Secure, monitor, and troubleshoot Azure solutions (20–25%)

Implement secure Azure solutions

Monitor and troubleshoot Azure solutions


AI-200 Practice Exams

AI-200 Practice Exam #1 (30 questions)

AI-200 Practice Exam #2 (30 questions)

AI-200 Practice Exam #3 (30 questions)

AI-200 Practice Exam #4 (30 questions)


Important AI-200 Resources

Link to the free, comprehensive, self-paced course on Microsoft Learn:

Develop AI cloud solutions on Azure

This course has 9 learning paths:

(1) Implement container application hosting on Azure

This learning path has 2 modules:
(i) Store and manage containers in Azure Container Registry
(ii) Deploy containers to Azure App Service

(2) Deploy and manage apps on Azure Container Apps

This learning path has 3 modules:
(i) Deploy containers to Azure Container Apps
(ii) Manage containers in Azure Container Apps
(iii) Scale containers in Azure Container Apps

(3) Deploy and monitor applications on Azure Kubernetes Service

This learning path has 3 modules:
(i) Deploy applications to Azure Kubernetes Service
(ii) Configure applications on Azure Kubernetes Service
(iii) Monitor and troubleshoot applications on Azure Kubernetes Service

(4) Develop AI solutions with Azure Cosmos DB for NoSQL

This learning path has 3 modules:
(i) Build queries for Azure Cosmos DB for NoSQL
(ii) Implement vector search on Azure Cosmos DB for NoSQL
(iii) Optimize query performance for Azure Cosmos DB for NoSQL

(5) Develop AI solutions with Azure Database for PostgreSQL

This learning path has 3 modules:
(i) Build and query with Azure Database for PostgreSQL
(ii) Implement vector search with Azure Database for PostgreSQL
(iii) Optimize vector search in Azure Database for PostgreSQL

(6) Enhance AI solutions with Azure Managed Redis

This learning path has 3 modules:
(i) Implement data operations in Azure Managed Redis
(ii) Implement event messaging with Azure Managed Redis
(iii) Implement vector storage in Azure Managed Redis

(7) Integrate backend services for AI solutions

This learning path has 3 modules:
(i) Queue and process AI operations with Azure Service Bus
(ii) Develop event-driven AI workflows with Azure Event Grid
(iii) Build serverless AI backends with Azure Functions

(8) Manage application secrets and configuration for AI solutions

This learning path has 2 modules:
(i) Manage application secrets with Azure Key Vault
(ii) Manage application settings with Azure App Configuration

(9) Observe and troubleshoot apps on Azure

This learning path has 2 modules:
(i) Instrument an app with OpenTelemetry
(ii) Analyze app telemetry with logs and metrics

Link to the certification page:

Link to the “Microsoft Certified: Azure AI Cloud Developer Associate” certification page.

Link to the study guide:

Link to the Study Guide for AI-200: Building Intelligent Applications.

A highly rated course on Udemy:

AI-200: Azure AI Cloud Developer Associate Exam Prep

YouTube Video Series

AI Cloud Developer AI-200 Series


Good luck to you passing the AI-200 Exam!
However, the more preparation you have, the less luck you will need. 🙂

Visit this post to see the list of all the certification preparation hubs available on The Data Community.

AI-200 Practice Exam #4 (30 questions)

This post/practice exam is a part of the AI-200: Developing AI Cloud Solutions on Azure  Exam Prep Hub.


Section 1 — Develop Containerized Solutions on Azure

Question 1 — Scenario: Container Apps Revision Strategy

A company hosts an AI inference API in Azure Container Apps.

The current production revision is v17. A new revision, v18, contains a significant change to the inference pipeline.

The development team wants to:

  • deploy v18 without immediately sending all users to it,
  • send 5% of production traffic to v18,
  • monitor the new revision,
  • increase traffic gradually,
  • immediately return traffic to v17 if errors increase.

No changes should be made to the container image itself.

Which approach should you use?

A. Configure a KEDA scaler to maintain 5% of replicas on v18.

B. Create a new Container Apps revision and use revision traffic splitting.

C. Create a new ACR repository for v18 and configure both repositories as application replicas.

D. Deploy v18 as an AKS Deployment and use a Service to distribute traffic.

Answer: B

Explanation

Container Apps revisions are designed for versioned application deployments. Multiple revisions can coexist, and traffic can be assigned between revisions.

KEDA controls scaling, not deployment traffic percentages. ACR repositories store images, while moving the workload to AKS would introduce an unnecessary architecture change.

A particularly important distinction for AI-200 is:

Revision management controls application versions and traffic; KEDA controls scaling.

The current study guide explicitly calls out Container Apps environments, revision management, and KEDA event-driven scaling.


Question 2 — Scenario: ACR Image Lifecycle

A company has an ACR repository containing:

ai-api:1.0
ai-api:1.1
ai-api:1.2
ai-api:latest

Production deployments must always use an immutable version rather than a mutable tag such as latest.

The deployment pipeline should also be able to identify exactly which image version was deployed.

Which approach is best?

A. Deploy ai-api:latest and record the deployment timestamp.

B. Deploy ai-api:1.2 and use immutable image identification such as its digest for deployment traceability.

C. Rebuild the image every time the application starts.

D. Store the Dockerfile in Azure Key Vault and rebuild the image during deployment.

Answer: B

Explanation

A versioned tag is preferable to latest for predictable deployments, and an image digest provides stronger immutability because it identifies the exact image content.

Using latest makes it possible for the same deployment configuration to resolve to different image content later.

The question tests the distinction between image versioning and mutable deployment references, both relevant to the ACR portion of AI-200. The study guide explicitly includes generating, storing, versioning, and managing container images in ACR.


Question 3 — Scenario: KEDA Scaling

An AI document-processing application runs in Azure Container Apps.

The application consumes messages from a queue.

During peak periods:

Queue messages: 18,000
CPU utilization: 22%
Memory utilization: 31%
Application replicas: 2

Messages are waiting several minutes before being processed.

The application currently scales based only on CPU utilization.

What should you change?

A. Increase the CPU limit for each replica.

B. Configure KEDA-based event-driven scaling using the queue workload.

C. Configure a Container Apps revision with 100% traffic.

D. Move the queue data into ACR.

Answer: B

Explanation

CPU is not the appropriate workload signal here. The actual bottleneck is the growing queue.

KEDA allows Container Apps to scale according to an external event source, making it appropriate for queue-driven workloads.

This is exactly the type of diagnostic reasoning that AI-200 expects: identify the workload signal rather than automatically scaling based on CPU.

The current Microsoft objectives explicitly identify KEDA event-driven scaling in Container Apps.


Question 4 — Matching: Container Deployment Concepts

Match each requirement to the most appropriate capability.

RequirementCapability
1. Automatically build an image from source code changesA. Container Apps revision
2. Run multiple versions of an application simultaneouslyB. KEDA
3. Scale based on an external event sourceC. ACR Task
4. Define Kubernetes resources declarativelyD. Kubernetes manifest

Answers

  • 1 → C
  • 2 → A
  • 3 → B
  • 4 → D

Explanation

  • ACR Tasks → automated image building.
  • Container Apps revisions → versioned application deployments.
  • KEDA → event-driven scaling.
  • Kubernetes manifests → declarative AKS resource configuration.

These distinctions are explicitly reflected in the current AI-200 containerization objectives.


Question 5 — Scenario: AKS Connectivity

An AI service is deployed to AKS.

The following observations have been made:

  • The Deployment reports the expected number of replicas.
  • Pods are in Running state.
  • Application logs show successful startup.
  • Requests through the application’s public endpoint fail.
  • Direct requests from within the pod to the application port succeed.

What should you investigate next?

A. The container registry’s image retention policy.

B. The Kubernetes Service, Ingress, selectors, and port mappings.

C. The application’s vector index.

D. The PostgreSQL connection pool.

Answer: B

Explanation

The evidence isolates the problem:

Container starts ✓
Application responds ✓
External access ✗

Therefore, the next layer to investigate is the connectivity path between the external endpoint and the pod.

Important areas include:

  • Service selectors
  • Service ports
  • target ports
  • Ingress configuration
  • ingress controller
  • routing/network configuration

The AI-200 study guide specifically calls for troubleshooting AKS and Container Apps by inspecting logs, events, and end-to-end connectivity.


Question 6 — Multiple Answers

A team wants to deploy the same containerized AI API to three environments:

Development
Test
Production

Which two practices are appropriate?

A. Build separate images solely because environment configuration differs.

B. Externalize environment-specific configuration.

C. Use environment variables/application settings where appropriate.

D. Embed production secrets in the Dockerfile.

Answers: B, C

Explanation

The same image should generally be reusable across environments.

Environment-specific configuration should be supplied externally, such as through application settings/environment variables or appropriate configuration services.

Production secrets should never be embedded in the image.

Microsoft explicitly includes configuring App Service to provide environment variables and secrets in the AI-200 objectives.


Question 7 — Scenario: AKS vs. Container Apps

A company is building an AI platform with these requirements:

  • Kubernetes manifests must be used.
  • The team needs direct access to Kubernetes resources.
  • Several specialized Kubernetes controllers will be installed.
  • The team already has substantial Kubernetes operational expertise.
  • Developers need Kubernetes-native workload configuration.

Which service should be selected?

A. Azure Container Apps

B. Azure App Service

C. Azure Functions

D. Azure Kubernetes Service

Answer: D

Explanation

The requirements explicitly depend on Kubernetes-native capabilities.

AKS is therefore the appropriate choice.

Container Apps provides a managed container application platform, but it intentionally abstracts away much of Kubernetes. When direct Kubernetes control is a requirement, AKS is the better fit.

The AI-200 objectives explicitly include deploying and managing AKS applications using manifest files.


Section 2 — Develop AI Solutions Using Azure Data Management Services

Question 8 — Cosmos DB Partitioning Scenario

An Azure Cosmos DB for NoSQL container stores documents for millions of customers.

The current partition key is:

/documentType

There are only a few document types, and one type contains approximately 80% of all documents.

The application experiences uneven request distribution and a heavily utilized partition.

What is the most likely underlying issue?

A. The partition key has poor cardinality and creates a hot partition.

B. The consistency level is necessarily too strong.

C. The vector embeddings are too large.

D. The container requires an Event Grid subscription.

Answer: A

Explanation

A good partition key should help distribute data and workload across logical partitions.

Using a low-cardinality property where one value dominates can result in uneven distribution and a hot partition.

This question is deliberately more architectural than simply asking which Cosmos DB query syntax to use.


Question 9 — Cosmos DB Query Optimization

A Cosmos DB query is:

SELECT *
FROM c
WHERE c.tenantId = @tenantId
AND c.status = "Active"
AND c.createdDate >= @date
ORDER BY c.createdDate DESC

The query executes frequently and consumes more RUs than expected.

The development team wants to investigate whether the indexing strategy matches the query workload.

What should they do?

A. Disable all indexing.

B. Examine the indexing policy and query characteristics, and optimize indexes for the actual query patterns.

C. Change the database to PostgreSQL.

D. Replace the query with an Event Grid event.

Answer: B

Explanation

Cosmos DB indexing is automatic by default, but indexing policies can be customized.

For performance-sensitive workloads, developers should understand which properties are being filtered/sorted and ensure that indexing aligns with query patterns rather than assuming that more indexing is always better.

Microsoft specifically identifies optimizing query performance and RU consumption through indexing policies and consistency levels.


Question 10 — Cosmos DB Change Feed Scenario

A document is inserted into Cosmos DB.

The application must automatically:

  1. Detect the new document.
  2. Generate an embedding.
  3. Store the embedding.
  4. Update a downstream search representation.

The application should not repeatedly query the entire container looking for new documents.

Which capability should be used?

A. Cosmos DB change feed processor

B. Cosmos DB strong consistency

C. Cosmos DB composite index

D. Redis expiration

Answer: A

Explanation

The change feed provides a mechanism for detecting changes to items.

A change feed processor can consume changes and drive downstream processing such as:

New document
↓
Change feed
↓
Embedding generation
↓
Vector storage

This is explicitly part of the AI-200 Cosmos DB objectives.


Question 11 — PostgreSQL Connection Optimization

An AI application creates a new PostgreSQL connection for every individual database operation.

Under heavy load, the application experiences:

  • high connection counts,
  • increased connection latency,
  • reduced throughput.

The database itself isn’t CPU-bound.

What should the developer investigate?

A. Connection pooling and connection reuse.

B. Increasing vector dimensionality.

C. Event Grid event filtering.

D. Cosmos DB consistency.

Answer: A

Explanation

Creating and tearing down database connections repeatedly introduces overhead.

Connection pooling and connection reuse can reduce connection establishment overhead and improve throughput and latency.

The current AI-200 study guide explicitly includes connection optimization to improve throughput and reduce latency for PostgreSQL.


Question 12 — PostgreSQL Vector Search

A RAG application stores:

document_id
tenant_id
document_type
content
embedding

Users should only retrieve documents belonging to their tenant.

The application needs semantic similarity retrieval.

Which approach should be implemented?

A. Search only on content.

B. Perform vector similarity search and apply the tenant metadata filter.

C. Use PostgreSQL connection pooling as the security boundary.

D. Use vector similarity scores as authorization decisions.

Answer: B

Explanation

Vector similarity identifies semantically relevant content.

Metadata filtering constrains the candidate set:

Tenant filter
↓
Eligible documents
↓
Vector similarity
↓
Relevant chunks

The vector similarity score itself should not be treated as an authorization mechanism.

The AI-200 study guide explicitly includes vector similarity, semantic retrieval, RAG, and metadata filtering.


Question 13 — PostgreSQL Vector Performance

A PostgreSQL database contains millions of embeddings.

Vector searches are accurate but increasingly slow.

Telemetry shows that CPU usage is very high during vector searches, while storage I/O remains relatively low.

Which two areas should be investigated first?

A. Vector indexing strategy.

B. pgvector query strategy.

C. Event Grid retry policy.

D. Azure Key Vault secret expiration.

Answers: A, B

Explanation

High CPU during vector similarity operations points toward the computational cost of vector search.

The developer should investigate:

  • the vector indexing strategy,
  • the query plan,
  • pgvector configuration,
  • similarity-search approach,
  • filtering strategy.

Microsoft explicitly identifies optimizing vector-search latency and reducing pgvector compute overhead.


Question 14 — Azure Managed Redis

An AI application uses Azure Managed Redis to cache generated answers.

The application has this requirement:

If a cached answer becomes stale, the application must not continue serving it indefinitely.

Which Redis capability directly addresses this requirement?

A. Event Grid filtering

B. Key expiration/TTL

C. Cosmos DB change feed

D. PostgreSQL pgvector

Answer: B

Explanation

Redis key expiration allows a key to automatically expire after a specified interval.

For example:

Cache answer
↓
TTL = 10 minutes
↓
Entry expires
↓
Application regenerates/retrieves result

The AI-200 objectives explicitly include Redis caching, expiration, and invalidation.


Question 15 — Multiple Answers: Data-Service Architecture

An AI application must support:

  • semantic retrieval,
  • frequently accessed results,
  • relational metadata,
  • millions of vector embeddings.

Which two architectural choices are reasonable?

A. PostgreSQL with pgvector can provide relational data plus vector search.

B. Redis can be used for caching frequently accessed results.

C. Key Vault should be used as the primary vector database.

D. Event Grid should replace the relational database.

Answers: A, B

Explanation

PostgreSQL with pgvector can combine relational modeling and vector search.

Azure Managed Redis can provide low-latency caching and vector-related capabilities.

Key Vault is a secret-management service, not a general-purpose vector database, and Event Grid is an event-routing service.

The current AI-200 course explicitly identifies PostgreSQL with pgvector and Azure Managed Redis as AI-oriented data services.


Section 3 — Connect to and Consume Azure Services

Question 16 — Service Bus Topic Architecture

An application publishes:

InvoiceProcessed

Three independent systems need to receive every event:

Billing Analytics
Notification Service
Audit Service

The publisher should publish the event once without knowing which consumers exist.

Which Service Bus configuration is most appropriate?

A. One queue with three consumers

B. One topic with a subscription for each consumer

C. Three queues populated manually by the publisher

D. One Redis key per consumer

Answer: B

Explanation

A Service Bus topic provides publish/subscribe semantics.

Each subscription receives its own copy of messages published to the topic.

Conceptually:

                  Topic
│
┌───────────┼───────────┐
▼ ▼ ▼
Billing Notify Audit
subscription subscription subscription

Queues are more appropriate for competing consumers where a message should normally be processed by one consumer.

Service Bus topics, subscriptions, messages, and dead-letter handling are part of the AI-200 objectives.


Question 17 — Service Bus Message Processing

A Service Bus worker receives a message and begins processing it.

The worker crashes before successfully completing the message operation.

What is the primary purpose of Service Bus message settlement/lock semantics in this situation?

A. To allow the message to be considered successfully processed without any acknowledgment.

B. To help prevent concurrent processing and allow unsuccessful processing to be retried according to the messaging semantics.

C. To convert the message into a vector embedding.

D. To permanently delete the message when the worker crashes.

Answer: B

Explanation

Service Bus supports message-lock and settlement concepts that help coordinate message processing.

A message isn’t simply considered successfully completed because a consumer received it.

If processing fails and the message isn’t successfully completed, it can become available for redelivery according to the applicable Service Bus behavior.

This is an important distinction between receiving and successfully completing a message.


Question 18 — Service Bus Dead-Letter Scenario

An AI processing service repeatedly receives a malformed message.

The message cannot be processed successfully.

The operations team wants failed messages separated from the normal processing path so that developers can inspect them later.

What should the application use?

A. Dead-letter queue

B. Redis cache

C. Event Grid custom event

D. Cosmos DB vector index

Answer: A

Explanation

The Service Bus dead-letter queue provides a dedicated location for messages that cannot be processed successfully or meet configured dead-lettering conditions.

It prevents a permanently problematic message from continuously interfering with normal processing.

Dead-letter queue management is explicitly included in AI-200.


Question 19 — Event Grid Filtering

A custom Event Grid topic receives:

DocumentUploaded
DocumentClassified
DocumentRejected
DocumentArchived

A subscriber is responsible only for rejected documents.

Which configuration minimizes unnecessary event delivery?

A. Increase the subscriber’s CPU.

B. Configure event subscription filtering.

C. Put all events into a Redis cache.

D. Use a Service Bus dead-letter queue.

Answer: B

Explanation

Event Grid subscription filters allow a subscriber to receive only events matching specified criteria.

Filtering is preferable to delivering every event and forcing the subscriber application to discard unwanted events.

Event filtering, custom events, and retries are explicitly listed in the current AI-200 objectives.


Question 20 — Event Grid Retry Scenario

An Event Grid subscriber is temporarily unavailable.

The publisher should not have to implement its own polling loop to repeatedly check whether the subscriber has recovered.

Which capability should be relied upon?

A. Event Grid retry behavior

B. Redis TTL

C. Cosmos DB consistency

D. AKS Horizontal Pod Autoscaler

Answer: A

Explanation

Event Grid provides delivery retry behavior for events that cannot initially be delivered successfully.

The purpose is to make event delivery more resilient to temporary endpoint failures.

Retry behavior is specifically included in the AI-200 Event Grid objectives.


Question 21 — Azure Functions Binding

A Function receives an HTTP request containing a document ID.

The Function must write a message to an Azure Service Bus queue.

The developer wants to use Azure Functions integration rather than manually implementing all of the Service Bus client code.

Which capability should be used?

A. HTTP trigger only

B. Service Bus output binding

C. Cosmos DB change feed

D. Event Grid event filter

Answer: B

Explanation

The HTTP trigger initiates function execution.

A Service Bus output binding can connect the function to the queue for output.

This illustrates the important distinction:

Trigger → causes execution
Binding → connects execution to data/services

Microsoft explicitly includes Functions triggers and bindings in the AI-200 objectives.


Question 22 — Fill in the Blank

Complete the statement:

An Azure Functions __________ determines what event or condition causes a function to execute.

Answer: trigger

Explanation

Examples include:

  • HTTP trigger
  • Service Bus trigger
  • Timer trigger
  • Event-based triggers supported by Functions

A binding is different: it provides a declarative connection to input or output data.


Question 23 — Scenario: Choosing Between Service Bus and Event Grid

An AI platform has these two requirements:

Requirement A

A document-processing job must be placed into a durable work queue. Multiple worker instances should compete for available jobs.

Requirement B

When processing completes, multiple independent systems should be notified that the document is complete.

Which design is best?

A. Event Grid for A and Redis for B

B. Service Bus queue for A and Event Grid for B

C. Redis queue for A and Cosmos DB change feed for B

D. Event Grid for both A and B

Answer: B

Explanation

Requirement A is a work-queue scenario:

Jobs → Service Bus queue → competing workers

Requirement B is an event notification/pub-sub scenario:

Processing complete → Event Grid → multiple subscribers

The distinction between messaging and event notification is important.

Microsoft’s AI-200 course specifically teaches both message-based and event-driven architectures using Service Bus and Event Grid.


Section 4 — Secure, Monitor, and Troubleshoot Azure Solutions

Question 24 — Key Vault and Application Identity

An Azure-hosted Function needs to retrieve a database password from Key Vault.

The security team prohibits storing a Key Vault credential in source code, configuration files, or the container image.

Which solution is most appropriate?

A. Embed the Key Vault credential in the Function package.

B. Store the password in App Configuration as plaintext.

C. Use an appropriate managed identity for the Function and grant it the required Key Vault access.

D. Put the password in an Event Grid event.

Answer: C

Explanation

A managed identity allows an Azure resource to authenticate to supported Azure services without the application having to maintain a long-lived credential for that identity.

Key Vault then remains responsible for storing the actual secret.

This follows the principle:

Application identity
↓
Key Vault authorization
↓
Secret retrieval

The AI-200 objectives explicitly include securing, rotating, and retrieving secrets using Key Vault.


Question 25 — App Configuration vs. Key Vault

An application has the following settings:

Feature:EnableSemanticCache = true
Feature:UseNewModel = false
AI:DeploymentName = gpt-production
Database:ConnectionPassword = ********

The team wants centralized configuration management while keeping secrets securely managed.

Which design is most appropriate?

A. Put all values in Key Vault.

B. Put all values in App Configuration.

C. Put non-secret configuration in App Configuration and secrets in Key Vault.

D. Put all values in environment variables inside the Docker image.

Answer: C

Explanation

App Configuration is intended for centralized application configuration.

Key Vault is intended for sensitive secrets.

Therefore:

App Configuration
├── feature flags/settings
├── deployment names
└── other non-secret configuration
Key Vault
└── passwords/API keys/secrets

The AI-200 study guide explicitly distinguishes the two capabilities.


Question 26 — Secret Rotation

A production AI service uses an API key stored in Key Vault.

The security team rotates the key regularly.

The development team wants the application to obtain the current secret without rebuilding or redeploying the container every time the key changes.

What design best meets the requirement?

A. Store the secret in the Dockerfile.

B. Store the secret in source control.

C. Retrieve the secret from Key Vault at runtime.

D. Put the secret into the container image during every deployment.

Answer: C

Explanation

Runtime retrieval separates the secret lifecycle from the application deployment lifecycle.

The container image remains unchanged while the secret can be rotated independently.

This is exactly the type of secret-management pattern targeted by AI-200.


Question 27 — OpenTelemetry Trace Analysis

An application exposes an HTTP endpoint.

A trace shows:

HTTP request 6,250 ms
│
├── Function execution 120 ms
├── Service Bus send 35 ms
├── PostgreSQL query 95 ms
├── Cosmos DB query 80 ms
└── External AI service 5,820 ms

The development team wants to reduce the endpoint’s response time.

What should they investigate first?

A. The external AI service call.

B. The Cosmos DB indexing policy.

C. The Service Bus queue’s dead-letter count.

D. The Docker image tag.

Answer: A

Explanation

The external AI service accounts for approximately 5.8 seconds of the 6.25-second request.

The trace therefore provides strong evidence that this dependency is the dominant contributor.

This is precisely why distributed tracing is valuable: it lets developers identify where time is being spent across service boundaries.

The AI-200 study guide specifically requires distributed tracing using OpenTelemetry SDKs.


Question 28 — KQL Interpretation

You have an AppRequests telemetry table containing:

TimeGenerated
DurationMs
Success

You need to identify the five-minute intervals during the last 30 minutes with the highest average request duration.

Which query is most appropriate?

A.

AppRequests
| where TimeGenerated > ago(30m)
| summarize AvgDuration = avg(DurationMs)
by bin(TimeGenerated, 5m)
| top 6 by AvgDuration desc

B.

AppRequests
| top 6 by DurationMs

C.

AppRequests
| summarize count() by Success

D.

AppRequests
| project TimeGenerated, DurationMs

Answer: A

Explanation

The requirement is to:

  1. Restrict data to the last 30 minutes.
  2. Group records into five-minute buckets.
  3. Calculate average duration for each bucket.
  4. Return the highest averages.

The query accomplishes all four.

Key KQL operators:

  • where → filters records.
  • bin() → creates time intervals.
  • summarize → aggregates.
  • avg() → calculates the average.
  • top → returns the highest values.

KQL analysis of logs and metrics is explicitly included in AI-200.


Question 29 — Multiple Answers: Troubleshooting

An AI application intermittently experiences slow requests.

Which two forms of telemetry would provide complementary information when diagnosing the problem?

A. Distributed traces showing the path and timing of individual requests.

B. Aggregate metrics showing latency, throughput, and error trends.

C. ACR image tags alone.

D. Dockerfile comments.

Answers: A, B

Explanation

Distributed traces answer questions such as:

“Where did this individual request spend its time?”

Metrics answer questions such as:

“Is latency increasing across the application?”

Using both provides a much stronger diagnostic picture than either alone.

OpenTelemetry distributed tracing and KQL-based analysis of logs and metrics are explicit AI-200 objectives.


Question 30 — Comprehensive Final Scenario

You are troubleshooting an AI document-processing platform:

                   HTTP API
│
▼
Azure Service Bus
│
▼
Azure Container Apps
│
┌────────┴────────┐
▼ ▼
Cosmos DB PostgreSQL

The operations team reports:

  • HTTP requests remain fast.
  • The Service Bus queue backlog increases dramatically during peak periods.
  • Container Apps CPU averages only 25%.
  • Container Apps memory averages 35%.
  • PostgreSQL latency remains normal.
  • Cosmos DB RU consumption remains normal.
  • Distributed traces show that once processing begins, each document is processed normally.
  • The application currently uses CPU-based scaling for Container Apps.

The company wants to minimize processing delay while avoiding unnecessary compute costs.

Which two actions should you take?

A. Configure KEDA event-driven scaling based on the queue workload.

B. Increase PostgreSQL compute capacity.

C. Investigate the queue backlog as the workload signal and tune scaling thresholds accordingly.

D. Increase Cosmos DB consistency to Strong.

Answers: A, C

Explanation

The evidence strongly indicates a scaling-signal problem.

The important observations are:

Queue backlog HIGH
CPU LOW
Memory LOW
Database latency NORMAL
Processing time NORMAL

The processor is healthy once it receives work, but insufficient replicas are being created while work is waiting in the queue.

Therefore:

  1. Use KEDA event-driven scaling based on the queue.
  2. Tune the scaling configuration around the actual workload signal.

Increasing PostgreSQL capacity or Cosmos DB consistency would not address the observed bottleneck.

This scenario combines several AI-200 competencies:

  • Container Apps
  • KEDA
  • Service Bus
  • scalability
  • telemetry
  • troubleshooting
  • architecture reasoning

The current study guide specifically identifies KEDA scaling and troubleshooting using logs, events, and end-to-end connectivity.


Go to the AI-200 Exam Prep Hub main page

AI-200 Practice Exam #3 (30 questions)

This post/practice exam is a part of the AI-200: Developing AI Cloud Solutions on Azure  Exam Prep Hub.


Section 1 — Develop Containerized Solutions on Azure

Question 1 — Scenario-Based: Container Apps Revisions

A company operates an AI summarization API in Azure Container Apps.

Revision 12 is currently serving all production traffic. The development team deploys revision 13, which contains a new model-integration implementation.

The team wants to:

  1. Send a small percentage of traffic to revision 13.
  2. Compare its behavior with revision 12.
  3. Increase traffic to revision 13 if testing is successful.
  4. Roll back quickly if problems occur.

Which Azure Container Apps capability should be used?

A. KEDA scaling rules

B. Container Apps revisions and traffic splitting

C. Azure Container Registry Tasks

D. AKS Horizontal Pod Autoscaler

Answer: B

Explanation

Azure Container Apps revisions allow multiple versions of an application to coexist. Traffic can be distributed between revisions, making revisions appropriate for controlled rollouts, testing, and rollback scenarios.

KEDA addresses event-driven scaling, not deployment traffic management. ACR Tasks builds container images, while AKS-specific autoscaling mechanisms aren’t required for a Container Apps deployment.

Microsoft specifically includes Container Apps environment configuration and revision management in the AI-200 objectives.


Question 2 — Scenario-Based: ACR Tasks

A development team has the following workflow:

Git repository
↓
Dockerfile
↓
Container image
↓
Azure Container Registry
↓
Azure Container Apps

Every time a change is committed to the application’s source repository, the team wants Azure to automatically build the image and publish it to ACR.

The team does not want to maintain a build VM.

Which solution should you implement?

A. Azure Container Registry Tasks

B. Azure Functions with a timer trigger

C. Azure App Service deployment slots

D. Azure Managed Redis

Answer: A

Explanation

Azure Container Registry Tasks provide cloud-based automation for building container images and can be triggered by source-code changes.

This is preferable to creating a custom VM-based build process when the requirement is specifically automated container-image building.

ACR Tasks are explicitly included in the AI-200 containerization objectives.


Question 3 — AKS Manifest Troubleshooting

An AI application is deployed to AKS using a Kubernetes manifest.

The deployment contains:

  • a Deployment
  • a Service
  • an Ingress

The pods are running successfully and the container logs show that the application started correctly.

However, requests sent through the public endpoint return connection errors.

Which investigation is the most appropriate next step?

A. Change the Cosmos DB consistency level.

B. Rebuild the container image using ACR Tasks.

C. Inspect the Service, Ingress, port mappings, selectors, and end-to-end network path.

D. Increase the Redis cache expiration interval.

Answer: C

Explanation

The successful pod startup and application logs indicate that the problem is probably beyond the container’s basic startup process.

The next logical layer is the connectivity path:

Internet
↓
Ingress
↓
Service
↓
Pod
↓
Container port

Incorrect selectors, ports, ingress configuration, or networking can prevent an otherwise healthy pod from receiving external requests.

Microsoft specifically includes troubleshooting AKS and Container Apps by examining logs, events, and end-to-end connectivity.


Question 4 — Multiple Answers

A company deploys an AI API to Azure Container Apps.

The application experiences sudden bursts of requests generated by a backend messaging workload. CPU utilization isn’t a reliable indicator of pending work.

Which two capabilities are relevant to designing the scaling solution?

A. KEDA event-driven scaling

B. Container Apps revision management

C. An event-based scaler that responds to the workload source

D. Azure Container Registry image versioning

Answers: A, C

Explanation

KEDA provides event-driven autoscaling and can scale applications based on external event sources.

Revision management handles versions of the application but doesn’t determine how replicas are added based on workload.

ACR image versioning manages images rather than application replica counts.

The AI-200 study guide explicitly identifies KEDA event-driven scaling in Container Apps.


Question 5 — Scenario-Based: App Service Container Configuration

A containerized AI application is deployed to Azure App Service.

The same image must be deployed to development, test, and production environments.

Each environment has a different value for:

AI_ENDPOINT
MODEL_NAME

The development team wants to use the same image in all three environments.

Which approach is most appropriate?

A. Build a different container image for every environment.

B. Store environment-specific values in the Dockerfile.

C. Supply environment-specific configuration through App Service application settings/environment variables.

D. Create a separate Azure Container Registry for each environment.

Answer: C

Explanation

Environment-specific configuration should generally be separated from the container image.

App Service can supply application settings to the container, allowing the same image to run in different environments with different configuration.

This approach improves portability and prevents configuration values from becoming embedded in the image.

Microsoft specifically identifies configuring App Service to supply environment variables and secrets as an AI-200 objective.


Question 6 — Matching: Container Technologies

Match each requirement to the best Azure capability.

RequirementCapability
1. Build container images in Azure based on source changesA. Container Apps revisions
2. Run several application versions simultaneouslyB. ACR Tasks
3. Automatically scale a containerized application based on an event sourceC. KEDA
4. Deploy a Kubernetes application using declarative resource definitionsD. AKS manifests

Answers

  • 1 → B
  • 2 → A
  • 3 → C
  • 4 → D

Explanation

Each technology addresses a different part of the container lifecycle:

  • ACR Tasks — automated container image builds.
  • Container Apps revisions — versioned application deployments.
  • KEDA — event-driven autoscaling.
  • AKS manifests — declarative Kubernetes application configuration.

These capabilities correspond directly to the containerization objectives in the current AI-200 study guide.


Question 7 — Scenario-Based: Selecting AKS

A company has developed an AI inference platform consisting of multiple containerized components.

The architecture team requires:

  • Kubernetes APIs and resource definitions
  • Fine-grained Kubernetes workload configuration
  • Direct control over Kubernetes networking and workloads
  • The ability to manage Kubernetes resources through manifests

The team is willing to take on the additional operational responsibility associated with Kubernetes.

Which service should they select?

A. Azure Functions

B. Azure App Service

C. Azure Container Apps

D. Azure Kubernetes Service

Answer: D

Explanation

AKS is the appropriate choice when the architecture requires direct use of Kubernetes concepts, APIs, manifests, and Kubernetes workload management.

Container Apps provides a more managed abstraction over containerized application hosting and is preferable when the team doesn’t require direct Kubernetes control.

The AI-200 objectives explicitly include deploying and managing applications on AKS using manifest files.


Section 2 — Develop AI Solutions Using Azure Data Management Services

Question 8 — Cosmos DB Query Optimization

An application uses Azure Cosmos DB for NoSQL.

A query filters on:

customerId
status
createdDate

The query returns only a small number of documents, but its RU consumption is unexpectedly high.

The team discovers that the indexing policy was designed without considering the application’s actual query patterns.

What should the team investigate first?

A. The indexing policy and query execution characteristics

B. Azure Function trigger configuration

C. Event Grid retry settings

D. Container Apps revision traffic

Answer: A

Explanation

Cosmos DB indexing policies have a direct impact on query performance and RU consumption.

Rather than indiscriminately increasing provisioned throughput, developers should first examine query patterns and indexing configuration to determine whether the container is appropriately indexed.

The current AI-200 guide specifically includes optimizing Cosmos DB query performance and RU consumption using indexing policies and consistency levels.


Question 9 — Cosmos DB Change Feed

A document-ingestion application stores uploaded documents in Cosmos DB.

After each document is inserted or updated, a downstream process must:

  1. Detect the change.
  2. Extract information from the document.
  3. Generate an embedding.
  4. Store the embedding.

The downstream process should not continuously poll the entire container.

Which Cosmos DB capability is the best fit?

A. Strong consistency

B. Vector similarity search

C. Change feed processor

D. Composite indexing only

Answer: C

Explanation

The Cosmos DB change feed provides a mechanism for detecting changes to items in a container.

A change feed processor can consume those changes and invoke downstream processing without repeatedly scanning the entire container.

This is particularly useful in AI ingestion pipelines where document changes trigger embedding or enrichment operations.

The current AI-200 objectives explicitly include implementing a change feed processor.


Question 10 — Vector Search

A RAG application stores 1 million document chunks in Cosmos DB for NoSQL.

Each chunk contains:

documentId
tenantId
content
embedding

A user query is converted into an embedding.

The application must retrieve semantically similar chunks while restricting results to the user’s tenant.

Which approach is most appropriate?

A. Search the content property using exact string matching.

B. Perform vector similarity search and apply a tenant metadata filter.

C. Use the Cosmos DB change feed to retrieve matching documents.

D. Increase the container’s consistency level to Strong.

Answer: B

Explanation

Vector similarity search provides semantic retrieval based on embeddings.

The tenant filter ensures that candidate documents are restricted to the appropriate security boundary.

Increasing consistency does not implement semantic retrieval, and the change feed is for detecting data changes rather than answering semantic queries.

The AI-200 objectives specifically include storing/retrieving embeddings, vector similarity search, semantic retrieval, and RAG patterns.


Question 11 — PostgreSQL Schema Design

An AI application stores customer information and document embeddings in Azure Database for PostgreSQL.

The application frequently performs:

WHERE tenant_id = ?
AND document_type = ?

followed by vector similarity search over the resulting records.

Which design consideration is most important?

A. Put all values into a single unstructured text column.

B. Avoid indexes because vector search cannot use metadata.

C. Store metadata in appropriately typed relational columns and design indexes around the query pattern.

D. Store tenant IDs in Azure Key Vault.

Answer: C

Explanation

PostgreSQL provides relational modeling capabilities that should be used appropriately.

Metadata used for filtering should be stored in appropriately typed columns, and indexing strategies should reflect the actual query workload.

Vector search and metadata filtering can then be combined for RAG-style retrieval.

The current AI-200 guide specifically includes schema modeling, data types, indexing strategies, vector similarity search, and metadata filters.


Question 12 — PostgreSQL Vector Workload

A PostgreSQL-based AI application performs vector searches against a large embedding dataset.

Performance analysis shows that vector operations consume substantial CPU.

The development team wants to reduce pgvector compute overhead.

Which area should they investigate?

A. Vector indexing and query strategy

B. Event Grid event filtering

C. Key Vault secret rotation

D. Container Apps revision traffic

Answer: A

Explanation

Vector indexing and query strategy are key factors in the computational cost of pgvector workloads.

An appropriate indexing strategy can reduce the amount of vector computation required for searches.

The AI-200 study guide specifically calls out optimizing query latency and reducing pgvector compute overhead.


Question 13 — PostgreSQL Resource Configuration

A vector-search workload is consistently CPU-bound.

The database contains enough storage, but vector searches are slow under concurrent load.

Which resource should the development team investigate first?

A. Event Grid retry count

B. Container image size

C. PostgreSQL compute and memory resources

D. Azure Key Vault SKU

Answer: C

Explanation

Vector workloads can be computationally intensive. If the workload is CPU-bound, database compute resources should be evaluated.

The AI-200 objectives specifically include configuring compute, memory, and storage resources to support PostgreSQL vector workloads.


Question 14 — Azure Managed Redis

An AI application stores frequently requested retrieval results in Azure Managed Redis.

A cached result should no longer be used after 10 minutes.

Which mechanism should the application use?

A. Cosmos DB change feed

B. Redis key expiration/TTL

C. PostgreSQL vector index

D. Event Grid retry policy

Answer: B

Explanation

Redis supports expiration through TTL semantics.

An application can assign an expiration time to cached data so that stale entries are automatically removed or become unavailable after the specified period.

Caching, expiration, and invalidation are explicitly part of the AI-200 Azure Managed Redis objectives.


Question 15 — Multiple Answers: AI Data Services

A RAG application uses Azure data services.

Which two practices are appropriate?

A. Use vector similarity search for semantic retrieval.

B. Use metadata filtering to restrict candidate records.

C. Treat vector similarity as an authorization mechanism.

D. Store secrets directly in vector metadata.

Answers: A, B

Explanation

Vector similarity is appropriate for semantic retrieval, while metadata filtering can constrain retrieval to relevant records such as a tenant, document type, or access scope.

Vector similarity alone should not be treated as an authorization mechanism. Secrets also shouldn’t be embedded into searchable metadata.

The current AI-200 objectives explicitly include vector similarity search, semantic retrieval, and RAG patterns with metadata filtering.


Section 3 — Connect to and Consume Azure Services

Question 16 — Service Bus Messaging Architecture

An AI application processes financial documents.

Each submitted document must be processed by exactly one available worker. The system may have several worker instances running simultaneously.

If a worker fails while processing a message, the system needs the message to become available for processing again according to Service Bus messaging semantics.

Which messaging pattern is most appropriate?

A. A Service Bus queue with competing consumers

B. An Event Grid topic with three identical subscriptions

C. A Redis cache

D. A Cosmos DB vector index

Answer: A

Explanation

A Service Bus queue can support competing consumers, allowing multiple worker instances to process messages from the same queue.

This differs from a topic with multiple subscriptions, where each subscription receives its own copy of published messages.

Service Bus queues, messages, and dead-letter handling are part of the AI-200 objectives.


Question 17 — Dead-Letter Handling

A Service Bus message has repeatedly failed processing.

The development team does not want the same malformed message to continue consuming normal processing resources.

What should happen to the message?

A. It should be placed in a dead-letter queue according to the configured dead-lettering behavior.

B. It should automatically become a Cosmos DB vector.

C. It should be moved to Azure App Configuration.

D. It should be converted into an Event Grid subscription.

Answer: A

Explanation

Service Bus provides dead-letter queues for messages that cannot be successfully processed or meet configured dead-letter conditions.

Dead-lettering separates problematic messages from normal processing so they can be inspected, repaired, or handled separately.

Dead-letter queue handling is explicitly identified in the AI-200 study guide.


Question 18 — Event Grid vs. Service Bus

An AI system publishes the event:

DocumentAnalysisCompleted

Multiple independent applications need to react to the event.

One application updates analytics, another sends notifications, and another updates a search index.

The publisher should not need to know which applications consume the event.

Which service is the best fit?

A. Azure Service Bus queue

B. Azure Key Vault

C. Azure Event Grid

D. Azure Managed Redis

Answer: C

Explanation

Event Grid is designed for event-driven architectures in which publishers emit events and independent subscribers react to them.

Custom events, filtering, and retries are among the Event Grid capabilities identified in the AI-200 objectives.


Question 19 — Event Grid Filtering

An Event Grid custom topic receives:

DocumentUploaded
DocumentAnalyzed
DocumentRejected

A subscriber should receive only:

DocumentRejected

What should you configure?

A. A Redis TTL

B. An Event Grid event subscription filter

C. A Service Bus dead-letter queue

D. A Cosmos DB indexing policy

Answer: B

Explanation

Event Grid event subscriptions can filter events so that subscribers receive only the events relevant to them.

This prevents every subscriber from having to receive and discard unrelated events.

Filtering is explicitly included in the AI-200 Event Grid objectives.


Question 20 — Azure Functions Binding Design

An HTTP-triggered Azure Function receives a document-processing request.

The function should place a message onto a Service Bus queue without requiring the developer to manually create and manage the Service Bus client in the function’s application logic.

Which capability should the developer consider?

A. A Service Bus output binding

B. An Event Grid retry policy

C. A Cosmos DB vector index

D. An AKS manifest

Answer: A

Explanation

Azure Functions bindings provide declarative integration with external services.

An output binding can allow a function to write to a Service Bus queue without requiring the application code to manually implement all of the messaging client plumbing.

The AI-200 objectives specifically include Functions triggers and bindings.


Question 21 — Functions Trigger Selection

A serverless AI backend must execute whenever a message arrives in a Service Bus queue.

Which trigger should be selected?

A. HTTP trigger

B. Timer trigger

C. Service Bus trigger

D. Cosmos DB output binding

Answer: C

Explanation

A Service Bus trigger causes an Azure Function to execute when the associated Service Bus messaging event occurs.

The distinction is important:

  • Trigger → initiates function execution.
  • Binding → provides an input/output connection to another service.

Azure Functions triggers and bindings are explicitly part of the AI-200 objectives.


Question 22 — Multiple Answers

An application uses Azure Event Grid for an event-driven workflow.

Which two capabilities can be used to make the workflow more resilient and selective?

A. Event filtering

B. Event delivery retries

C. PostgreSQL pgvector indexes

D. Container Apps revisions

Answers: A, B

Explanation

Event filtering prevents irrelevant events from being delivered to a subscriber.

Retry behavior allows Event Grid to attempt delivery again when a subscriber endpoint temporarily fails.

Both are specifically included in the AI-200 Event Grid objectives.


Question 23 — Fill in the Blank

Complete the statement:

In Azure Functions, a __________ initiates function execution, while a binding provides a declarative connection to input or output data.

Answer: trigger

Explanation

A trigger defines the event that causes a function to execute.

For example, an HTTP trigger can execute a function when an HTTP request arrives, while a Service Bus trigger can execute a function when a message becomes available.

Bindings provide connections to external services and data.

This distinction is fundamental to the Functions portion of AI-200.


Section 4 — Secure, Monitor, and Troubleshoot Azure Solutions

Question 24 — Key Vault Security

An application retrieves an API key from Azure Key Vault.

The development team wants the application to access the secret without embedding a permanent credential for Key Vault inside the application source code.

Which approach is most appropriate?

A. Store the Key Vault credential in the container image.

B. Store the credential in the Git repository.

C. Use an appropriate Azure identity-based authentication mechanism and grant the application the required Key Vault permissions.

D. Put the credential in an Event Grid event.

Answer: C

Explanation

The goal is to avoid introducing another hard-coded secret while accessing Key Vault.

An Azure-hosted application can use an appropriate managed identity or other supported identity mechanism, with permissions scoped to the required Key Vault operations.

The AI-200 security objectives include secure secret storage, retrieval, and rotation using Key Vault.


Question 25 — Key Vault vs. App Configuration

A development team identifies the following values:

MaxRetries = 5
EnableNewRAGPipeline = true
ModelDeployment = "production"
DatabasePassword = "..."
ExternalApiKey = "..."

Which design is most appropriate?

A. Store all five values in Key Vault.

B. Store all five values in App Configuration.

C. Store non-sensitive configuration in App Configuration and sensitive values in Key Vault.

D. Store all five values in Redis.

Answer: C

Explanation

App Configuration is designed for application settings and configuration values.

Key Vault is designed for secrets such as passwords and API keys.

The distinction is important because configuration management and secret management serve different purposes.

Microsoft explicitly identifies both Key Vault and App Configuration in the AI-200 security objectives.


Question 26 — Secret Rotation

A security policy requires an AI service API key to be rotated periodically.

The application should always retrieve the current valid value rather than requiring a code deployment whenever the key changes.

Which architecture is most appropriate?

A. Hard-code the key in the application.

B. Store the key in Key Vault and retrieve it at runtime using an appropriate identity.

C. Put the key into an Event Grid event.

D. Bake the key into the Docker image during the build.

Answer: B

Explanation

Key Vault provides secure storage and retrieval of secrets and supports secret lifecycle management.

Separating the secret from the application binary/container image allows the secret to be rotated independently of application deployment.

Secret rotation and retrieval are explicitly listed in the AI-200 objectives.


Question 27 — OpenTelemetry Troubleshooting

A distributed AI application produces the following trace:

HTTP request 4.8 seconds
├── API processing 150 ms
├── Cosmos DB query 120 ms
├── PostgreSQL query 210 ms
└── AI inference service 4.1 seconds

Which conclusion is best supported by this telemetry?

A. The container image is too large.

B. Cosmos DB indexing is necessarily incorrect.

C. Service Bus dead-lettering is causing the latency.

D. The AI inference service is the dominant contributor to request latency.

Answer: D

Explanation

The trace shows approximately 4.1 seconds of the 4.8-second request duration being spent in the AI inference service.

Distributed traces are particularly valuable because they expose timing across service boundaries and help isolate latency contributors.

OpenTelemetry distributed tracing is explicitly part of the AI-200 monitoring objectives.


Question 28 — KQL

You are analyzing an application telemetry table called AppRequests.

You need to calculate the average request duration by five-minute interval during the last hour.

Which query is the most appropriate?

A.

AppRequests
| where TimeGenerated > ago(1h)
| summarize avg(DurationMs) by bin(TimeGenerated, 5m)

B.

AppRequests
| top 5 by DurationMs

C.

AppRequests
| project DurationMs

D.

AppRequests
| where DurationMs > 5000

Answer: A

Explanation

The query needs three operations:

  1. Restrict the time range to one hour.
  2. Group records into five-minute intervals.
  3. Calculate the average duration within each interval.

bin(TimeGenerated, 5m) creates the required time buckets, and avg(DurationMs) calculates the average duration.

KQL analysis of logs and metrics is explicitly included in the AI-200 objectives.


Question 29 — Multiple Answers: Telemetry

A distributed AI application is experiencing intermittent latency.

Which two telemetry approaches would provide the most useful information for diagnosing the problem?

A. Distributed traces showing individual request paths

B. Metrics showing aggregate latency/request behavior

C. Container registry repository names

D. Docker image tags

Answers: A, B

Explanation

Distributed traces can show where individual requests spend time across service boundaries.

Metrics provide aggregate information about application behavior, such as latency, request rate, and error rates.

Image tags and registry repository names are useful deployment metadata but aren’t substitutes for runtime telemetry.

OpenTelemetry instrumentation and telemetry analysis are explicitly included in the current AI-200 study guide.


Question 30 — Comprehensive Scenario

A company operates an AI document-processing platform:

                ┌───────────────────────┐
                │   HTTP API            │
                │   Azure Functions     │
                └───────────┬───────────┘
                            │
                            ▼
                    Azure Service Bus
                            │
                            ▼
                Containerized processor
                            │
              ┌─────────────┴─────────────┐
              ▼                           ▼
       Cosmos DB                      PostgreSQL
       documents                     vector search
              │
              ▼
        Embedding data

The application has recently experienced intermittent failures.

The team observes:

  • The HTTP API responds quickly.
  • Service Bus message counts occasionally increase significantly.
  • Container processor CPU usage is low.
  • PostgreSQL latency remains normal.
  • Distributed traces show that some messages wait several minutes before processing begins.
  • The application currently scales the processor based primarily on CPU utilization.

What should the team implement to address the primary bottleneck?

A. Increase PostgreSQL compute.

B. Increase Cosmos DB consistency.

C. Implement event-driven scaling for the container processor based on the messaging workload.

D. Increase OpenTelemetry sampling.

Answer: C

Explanation

The most important clues are:

  • Service Bus backlog increases.
  • CPU remains low.
  • Messages wait before processing.
  • The current scaling strategy is CPU-oriented.

The processor therefore isn’t scaling in response to the actual workload.

For a containerized application running in Azure Container Apps, KEDA-based event-driven scaling can scale replicas according to an external event source or workload metric.

Increasing PostgreSQL resources would not address the observed queue backlog because PostgreSQL latency is normal.

OpenTelemetry has already provided useful diagnostic information, but increasing sampling would not resolve the scaling problem.

This question combines the AI-200 containerization, messaging, monitoring, and troubleshooting objectives and represents the type of cross-topic reasoning expected from an experienced Azure developer.


Go to the AI-200 Exam Prep Hub main page

AI-200 Practice Exam #2 (30 questions)

This post is a part of the AI-200: Developing AI Cloud Solutions on Azure  Exam Prep Hub.


Section 1 — Develop Containerized Solutions on Azure

Questions 1–7


Question 1 — Scenario-Based: Azure Container Apps

A company has developed an AI inference service as a container image.

The application has the following requirements:

  • It must run continuously while requests are being processed.
  • It should scale horizontally when request volume increases.
  • The team does not want to manage Kubernetes control planes or nodes.
  • The application will eventually have multiple versions running during controlled releases.
  • The team wants to use container images stored in Azure Container Registry.

Which Azure service is the best hosting platform?

A. Azure Kubernetes Service
B. Azure Functions
C. Azure Container Apps
D. Azure Storage static website

Answer: C

Explanation

Azure Container Apps is designed for running containerized applications without requiring the development team to manage Kubernetes infrastructure directly. It supports container images, scaling, revisions, and environment configuration.

AKS would provide considerably more Kubernetes control, but it also introduces additional management responsibilities. Azure Functions is appropriate for serverless functions rather than a continuously running containerized service of this type.

The AI-200 objectives specifically include deploying containers to Container Apps, configuring environments, managing revisions, and implementing event-driven scaling with KEDA.


Question 2 — Azure Container Registry Tasks

A development team has a Dockerfile stored in a Git repository.

Whenever changes are committed to the repository, the team wants Azure to automatically build a new container image and push it to Azure Container Registry.

The team does not want to maintain a dedicated build server.

Which solution should you implement?

A. Configure an Azure Container Registry Task with a source-code trigger
B. Create an AKS CronJob that executes Docker
C. Configure an App Service deployment slot
D. Create an Azure Function with a timer trigger that builds the image

Answer: A

Explanation

Azure Container Registry Tasks can automate container image builds in Azure. They can be triggered by source-code changes and can build and push images to ACR.

The important distinction is that ACR Tasks are specifically designed for container image build automation. App Service slots and Azure Functions don’t provide the same purpose-built container build capability.

ACR Tasks are explicitly part of the AI-200 containerization objectives.


Question 3 — AKS Deployment Troubleshooting

You deploy an AI API to AKS using a Kubernetes deployment manifest.

The deployment reports that the pods have been created, but the application is inaccessible from outside the cluster.

You verify that:

  • The container image can be pulled.
  • The pods are running.
  • The application process is listening on the expected container port.

What should you investigate next?

A. The Azure Container Registry retention policy
B. The PostgreSQL connection pool
C. The Cosmos DB indexing policy
D. The Kubernetes Service and ingress/network configuration

Answer: D

Explanation

If the pods are running and the application is listening correctly, the next logical area is connectivity between the pods and external clients.

In AKS, this can involve the Kubernetes Service, ingress configuration, ports, selectors, networking, and related resources.

The AI-200 study guide specifically calls out monitoring and troubleshooting AKS and Container Apps by inspecting logs, events, and end-to-end connectivity.


Question 4 — Multiple Answers

An application is deployed to Azure Container Apps.

The application has two revisions:

  • Revision A — currently serving production traffic
  • Revision B — newly deployed version

The development team wants to validate Revision B before directing production traffic to it.

Which two capabilities are relevant?

A. Azure Container Registry Tasks
B. Container Apps revision management
C. Revision traffic management
D. Cosmos DB change feed

Answers: B, C

Explanation

Azure Container Apps supports revisions, allowing different versions of an application to coexist. Traffic can be managed between revisions, supporting controlled deployments and testing.

ACR Tasks handles container image builds and is not responsible for Container Apps traffic management.

Microsoft explicitly includes revision management in the AI-200 Container Apps objectives.


Question 5 — Container Apps Scaling

An AI application receives requests through an event-driven architecture.

Under normal conditions, there may be only a few messages waiting to be processed. During business events, thousands of messages may accumulate.

The application should automatically create additional container replicas when the message workload increases.

Which capability is most appropriate?

A. App Service deployment slots
B. ACR geo-replication
C. KEDA-based event-driven scaling
D. AKS node autoscaling only

Answer: C

Explanation

KEDA—Kubernetes Event-driven Autoscaling—allows Container Apps to scale based on external event sources and metrics.

This differs from simply scaling based on CPU or memory. A queue-length or other event-based workload is a classic use case for event-driven scaling.

The AI-200 study guide specifically identifies KEDA as the mechanism for event-driven scaling in Container Apps.


Question 6 — Multiple Answers

You are diagnosing a failing AKS deployment.

Which two sources should you inspect to help determine why the application is not behaving as expected?

A. Kubernetes/application logs
B. Kubernetes events
C. Azure App Configuration feature flags only
D. PostgreSQL vector indexes

Answers: A, B

Explanation

Application and container logs can reveal runtime failures, exceptions, and startup problems. Kubernetes events can reveal scheduling problems, image-pull failures, probe failures, container restarts, and other cluster-level conditions.

The AI-200 objectives explicitly include inspecting logs and events when troubleshooting AKS and Container Apps.


Question 7 — App Service Container Configuration

A containerized AI API runs on Azure App Service.

The application requires a configuration value named AI_ENDPOINT and a sensitive value named API_KEY.

The development team wants these values supplied to the container as environment variables rather than hard-coded into the image.

Which approach is most appropriate?

A. Configure App Service application settings/environment variables and use a secure secret-management approach for the sensitive value
B. Add both values directly to the Dockerfile
C. Store both values in the container image metadata
D. Put both values in the ACR repository name

Answer: A

Explanation

App Service can supply application configuration to a container through application settings/environment variables. Sensitive values should not be baked into the container image.

The AI-200 study guide specifically includes configuring App Service to supply environment variables and secrets.


Section 2 — Develop AI Solutions Using Azure Data Management Services

Questions 8–15


Question 8 — Cosmos DB Consistency and RU Consumption

An AI application uses Azure Cosmos DB for NoSQL.

The application does not require every read to immediately reflect the latest write. However, it performs a very large number of reads, and the development team wants to optimize the workload’s consistency/performance tradeoff.

Which Cosmos DB configuration area should they investigate?

A. Container Apps revision settings
B. Consistency level
C. Azure Functions trigger type
D. Event Grid retry policy

Answer: B

Explanation

Cosmos DB consistency levels determine the guarantees provided when reading data. Stronger consistency generally involves different performance and availability tradeoffs than weaker consistency levels.

The AI-200 study guide explicitly includes optimizing Cosmos DB query performance and RU consumption by using indexing policies and consistency levels.


Question 9 — Cosmos DB Query Optimization

A Cosmos DB query frequently filters documents using a property called departmentId.

The query is expensive and consumes more RUs than expected.

The development team discovers that the property is excluded from the container’s indexing policy.

What should they consider doing?

A. Increase the Service Bus lock duration
B. Create a KEDA scaler
C. Move the documents to Azure Managed Redis
D. Modify the indexing policy to appropriately index the property

Answer: D

Explanation

Cosmos DB indexing policies determine which paths are indexed and therefore influence query execution and RU consumption.

If a frequently filtered property isn’t appropriately indexed, changing the indexing policy may improve query performance and reduce unnecessary RU consumption.

Indexing policies are explicitly part of the AI-200 Cosmos DB objectives.


Question 10 — Cosmos DB Vector Search

An AI application stores the following document:

{
"id": "doc-1024",
"tenantId": "contoso",
"text": "Azure provides cloud-based AI services...",
"embedding": [ ... ]
}

The application receives a query embedding and needs to retrieve semantically similar documents.

Which capability should be implemented?

A. Cosmos DB vector similarity search
B. Cosmos DB change feed only
C. Azure Functions timer trigger
D. Service Bus topic filtering

Answer: A

Explanation

The embedding represents the semantic characteristics of the document. Vector similarity search compares the query embedding with stored embeddings to identify semantically similar content.

This is a core AI workload supported by Cosmos DB for NoSQL and is explicitly included in the AI-200 objectives.


Question 11 — Scenario-Based RAG

A RAG application stores documents for multiple customers in Azure Database for PostgreSQL.

Each vector record includes:

  • tenant_id
  • document_type
  • content
  • embedding

A user from tenant A asks a question.

The application must ensure that results from tenant B are never returned, even if tenant B contains documents that are more semantically similar.

Which approach should be used?

A. Increase vector dimensions
B. Perform vector similarity search with a metadata filter for tenant_id
C. Use Event Grid to filter documents
D. Store tenant IDs in Azure Key Vault

Answer: B

Explanation

The vector search provides semantic similarity, while the metadata filter constrains the candidate records to the correct tenant.

This is especially important in multi-tenant RAG architectures. Semantic similarity alone should not be treated as an authorization boundary.

The AI-200 study guide specifically includes RAG patterns using vector search with metadata filters.


Question 12 — PostgreSQL Performance

An application performs thousands of short database operations against Azure Database for PostgreSQL.

Performance testing shows that establishing a new database connection for every request introduces significant latency.

Which optimization should be considered?

A. Increase the number of Event Grid subscriptions
B. Use connection pooling or otherwise optimize connection reuse
C. Replace PostgreSQL with ACR
D. Store all database credentials in source code

Answer: B

Explanation

Creating and tearing down database connections repeatedly introduces overhead. Connection pooling allows connections to be reused across operations, improving throughput and reducing connection-establishment latency.

Connection optimization is explicitly listed in the current AI-200 study guide.


Question 13 — Azure Managed Redis

An AI application repeatedly retrieves the same expensive results from a backend data service.

The results can safely remain cached for five minutes.

After five minutes, the application should retrieve fresh data.

Which Azure Managed Redis capability is most directly applicable?

A. Change feed processing
B. PostgreSQL vector indexing
C. Service Bus dead-lettering
D. Key expiration/TTL

Answer: D

Explanation

Redis supports expiration/TTL semantics, allowing cached data to automatically expire after a specified period.

This is useful when data should remain cached temporarily but must eventually be refreshed.

The AI-200 objectives specifically include caching, expiration, and invalidation using Azure Managed Redis.


Question 14 — Multiple Answers

An AI application uses Azure Managed Redis.

Which two capabilities are directly relevant to AI workloads covered by AI-200?

A. Vector indexing for similarity search
B. Caching frequently accessed data
C. Kubernetes manifest deployment
D. Azure Function trigger execution

Answers: A, B

Explanation

Azure Managed Redis can be used for low-latency caching and supports vector storage/indexing capabilities for AI scenarios.

Kubernetes manifests belong to AKS, while Function triggers belong to Azure Functions.

The current AI-200 study guide specifically identifies Redis caching, expiration/invalidation, and vector indexing.


Question 15 — Matching: AI Data Services

Match each requirement to the best Azure technology.

RequirementTechnology
1. Detect newly inserted or modified Cosmos DB itemsA. Azure Managed Redis
2. Perform relational vector search using PostgreSQLB. Azure Cosmos DB change feed
3. Cache frequently accessed AI results with expirationC. Azure Database for PostgreSQL with pgvector
4. Perform low-latency vector operations in RedisD. Azure Managed Redis vector capabilities

Answers

  • 1 → B
  • 2 → C
  • 3 → A
  • 4 → D

Explanation

The Cosmos DB change feed is designed to detect item changes. PostgreSQL can use pgvector for vector workloads. Managed Redis provides low-latency caching and expiration as well as vector capabilities.

These capabilities map directly to the data-management objectives in the current AI-200 guide.


Section 3 — Connect to and Consume Azure Services

Questions 16–23


Question 16 — Service Bus vs. Event Grid

An AI application needs reliable asynchronous processing of individual work items.

Each work item represents a document that must be processed exactly as part of an application workflow. If processing fails, the message must remain available for retry or dead-letter handling.

Which service is the better fit?

A. Event Grid
B. Azure App Configuration
C. Azure Managed Redis
D. Azure Service Bus

Answer: D

Explanation

Azure Service Bus is designed for enterprise messaging and reliable asynchronous processing. It supports queues, topics, subscriptions, message handling, and dead-letter queues.

Event Grid is primarily an event-routing service for reactive architectures. When the requirement centers on reliable message processing and dead-letter handling, Service Bus is generally the better fit.

These capabilities are explicitly included in the AI-200 messaging objectives.


Question 17 — Service Bus Topic Architecture

An AI document-processing application publishes a single event whenever a document is processed.

Three independent applications need to react to the event:

  1. Billing
  2. Analytics
  3. Notification

Each application must independently receive the events.

Which Service Bus architecture should you use?

A. A topic with separate subscriptions
B. A single queue consumed by all applications
C. A Redis key with a five-minute expiration
D. A Function timer trigger

Answer: A

Explanation

A Service Bus topic allows a publisher to send messages once while multiple subscriptions independently receive messages.

This is appropriate when several consumers need their own copy/stream of messages.

Queues are more appropriate when competing consumers share work rather than when independent applications each need to receive the published message.

Topics and subscriptions are explicitly part of the AI-200 objectives.


Question 18 — Event Grid Filtering

A custom Event Grid topic receives events from several types of AI processing operations.

A downstream service should receive only events where:

eventType = "DocumentAnalysisCompleted"

What should you configure?

A. A Service Bus dead-letter queue
B. An App Service deployment slot
C. An Event Grid event subscription with filtering
D. A Cosmos DB indexing policy

Answer: C

Explanation

Event Grid subscriptions can use event filtering to restrict which events are delivered to a subscriber.

This allows a publisher to emit multiple event types while individual consumers receive only events relevant to them.

Event Grid filters, custom events, and retry behavior are explicitly listed in the AI-200 objectives.


Question 19 — Event Grid Retry Behavior

An Event Grid subscriber’s endpoint is temporarily unavailable.

The application should allow Event Grid to attempt delivery again rather than permanently losing the event immediately.

Which Event Grid capability should you configure?

A. Vector indexing
B. Event delivery retry policy
C. Container Apps revision
D. Cosmos DB consistency level

Answer: B

Explanation

Event Grid provides retry capabilities for event delivery. Retry configuration allows applications to tolerate temporary endpoint failures.

Retry behavior is distinct from Service Bus dead-lettering. Service Bus is designed around reliable messaging and message processing, while Event Grid provides event routing with retry and delivery semantics.

The AI-200 study guide explicitly identifies Event Grid retries as an exam objective.


Question 20 — Azure Functions Architecture

An AI backend must expose an HTTP endpoint:

POST /documents

The endpoint accepts a document and places a processing request onto a Service Bus queue.

The backend should be serverless.

Which Azure Functions design is most appropriate?

A. Timer-triggered function that polls the HTTP endpoint
B. Event Grid-triggered function with a Redis output
C. Cosmos DB change-feed function
D. HTTP-triggered function with a Service Bus output binding

Answer: D

Explanation

An HTTP trigger can expose the API endpoint. A Service Bus output binding can then send the processing message to a queue.

This design avoids unnecessary polling and allows the HTTP-facing function to remain lightweight while the actual document processing happens asynchronously.

The AI-200 objectives include serverless APIs, triggers, bindings, and function-app deployment.


Question 21 — Azure Functions Trigger vs. Binding

A developer creates an Azure Function that should execute whenever a new message arrives in a Service Bus queue.

Which component determines when the function executes?

A. Trigger
B. Output binding
C. Application setting
D. Deployment slot

Answer: A

Explanation

The trigger defines the event that causes the function to execute.

A binding provides a declarative connection between the function and another service or data source. The trigger is therefore the component responsible for initiating execution.

Triggers and bindings are explicitly included in the AI-200 Functions objectives.


Question 22 — Multiple Answers

A development team is choosing between Azure Service Bus and Event Grid for an AI backend.

Which two statements are correct?

A. Service Bus is appropriate for reliable message-based processing.
B. Event Grid is designed for event-driven routing and supports event filtering.
C. Event Grid replaces Azure Key Vault for secret storage.
D. Service Bus is primarily a container image registry.

Answers: A, B

Explanation

Service Bus provides messaging capabilities such as queues, topics, subscriptions, and dead-letter queues.

Event Grid provides event routing and supports capabilities such as custom events, filtering, and retries.

Neither service is a secret-management or container-registry service.


Question 23 — Fill in the Blank

Complete the statement:

In Azure Functions, a __________ defines the event or condition that causes a function to execute, while a binding provides a connection to input or output data.

Answer: trigger

Explanation

A Function trigger determines when the function executes. Bindings simplify access to external resources and can provide input or output data.

Understanding this distinction is fundamental to designing serverless AI backends with Azure Functions.


Section 4 — Secure, Monitor, and Troubleshoot Azure Solutions

Questions 24–30


Question 24 — Key Vault Secret Rotation

An AI application uses an API key stored in Azure Key Vault.

The security team requires the secret to be rotated periodically without requiring developers to modify application source code.

Which approach best addresses the requirement?

A. Implement secret rotation and have the application retrieve the current secret from Key Vault
B. Store a second copy of the secret in the Dockerfile
C. Put the secret in an Event Grid event
D. Store the secret as a PostgreSQL vector

Answer: A

Explanation

Key Vault is designed to securely store secrets and supports secret lifecycle management. Applications can retrieve the current value rather than embedding secrets in source code or container images.

The current AI-200 study guide specifically includes secret rotation and retrieval using Azure Key Vault.


Question 25 — Key Vault vs. App Configuration

An application has the following configuration:

  • MaxDocumentsPerRequest = 25
  • EnableSemanticSearch = true
  • DatabaseConnectionPassword = [secret]
  • AIServiceApiKey = [secret]

Which approach is most appropriate?

A. Store everything in Azure Container Registry
B. Store everything in Azure App Configuration
C. Store non-secret configuration in App Configuration and secrets in Key Vault
D. Store everything in Service Bus

Answer: C

Explanation

Azure App Configuration is designed for centralized application settings and configuration.

Azure Key Vault is designed for sensitive values such as passwords and API keys.

Separating ordinary configuration from secrets provides a more appropriate security and configuration-management architecture.

Both services are explicitly included in the AI-200 security objectives.


Question 26 — OpenTelemetry

A distributed AI application has this request path:

Client
↓
API
↓
Document service
↓
PostgreSQL
↓
AI inference service

Users report that some requests take 8–10 seconds.

The development team needs to determine which component contributes most of the latency for each individual request.

Which capability is most appropriate?

A. OpenTelemetry distributed tracing
B. ACR image replication
C. Cosmos DB change feed
D. Service Bus topic filtering

Answer: A

Explanation

Distributed tracing allows developers to follow a request through multiple services and identify where time is being spent.

OpenTelemetry provides standardized instrumentation for collecting telemetry across distributed applications.

The AI-200 study guide specifically identifies tracing distributed systems using OpenTelemetry SDKs.


Question 27 — KQL

You have an Azure Monitor Logs table called AppRequests.

You need to find the 10 slowest requests from the previous hour.

Which query is the best starting point?

A.

AppRequests
| summarize count()

B.

AppRequests
| where TimeGenerated > ago(1h)
| summarize avg(DurationMs)

C.

AppRequests
| project DurationMs

D.

AppRequests
| where TimeGenerated > ago(1h)
| top 10 by DurationMs desc

Answer: D

Explanation

The query needs to:

  1. Restrict records to the previous hour.
  2. Sort/select the highest-duration requests.
  3. Return only the top 10.

top 10 by DurationMs desc directly satisfies the requirement.

KQL is explicitly part of the AI-200 monitoring objectives for analyzing logs and metrics.


Question 28 — Multiple Answers

You instrument an AI application with OpenTelemetry.

Which two types of telemetry are particularly useful when diagnosing performance problems in a distributed application?

A. Container image tags
B. Traces
C. Metrics
D. ACR repository names

Answers: B, C

Explanation

Traces can show the path and timing of individual requests across distributed services.

Metrics can reveal aggregate measurements such as latency, request rates, error rates, or resource-related behavior.

Container image tags and ACR repository names are deployment metadata rather than the primary telemetry types used for distributed performance analysis.

OpenTelemetry and telemetry analysis are explicitly included in the AI-200 monitoring objectives.


Question 29 — KQL Scenario

An AI application has started returning HTTP 500 errors.

You want to determine whether the errors increased significantly during the last 30 minutes.

Which KQL query is the most useful starting point?

A.

AppRequests
| where TimeGenerated > ago(30m)
| summarize count() by bin(TimeGenerated, 5m), ResultCode

B.

AppRequests
| project TimeGenerated

C.

AppRequests
| summarize avg(DurationMs)

D.

AppRequests
| top 1 by TimeGenerated

Answer: A

Explanation

The query:

  • restricts data to the last 30 minutes,
  • groups data into five-minute intervals,
  • separates results by HTTP result code,
  • and counts the requests.

This allows the development team to observe whether HTTP 500 responses increased during particular time intervals.

The ability to write KQL queries to analyze logs and metrics is part of the current AI-200 study guide.


Question 30 — Scenario-Based Troubleshooting

An AI API is running in Azure Container Apps.

The application works correctly under light load. Under heavy load, however:

  • request latency increases significantly,
  • CPU usage remains relatively low,
  • the application receives work from a messaging system,
  • and the number of pending messages increases continuously.

The development team wants the application to automatically add replicas based on the workload rather than CPU utilization.

What should you implement?

A. KEDA event-driven scaling based on the messaging workload
B. A larger Azure Container Registry SKU
C. A stronger Cosmos DB consistency level
D. OpenTelemetry sampling alone

Answer: A

Explanation

The critical clue is that the workload is message-driven and the backlog is increasing while CPU utilization remains low.

CPU-based autoscaling would not necessarily respond appropriately. KEDA allows Container Apps to scale based on event-driven workload characteristics, such as the number of pending messages.

OpenTelemetry could help diagnose the latency, but instrumentation alone would not automatically add replicas.

KEDA-based event-driven scaling is explicitly identified in the AI-200 containerized-solutions objectives.


Go to the AI-200 Exam Prep Hub main page

AI-200 Practice Exam #1 (30 questions)

This post/practice exam is a part of the AI-200: Developing AI Cloud Solutions on Azure  Exam Prep Hub.


Section 1 — Develop Containerized Solutions on Azure

Questions 1–7


Question 1 — Single Answer

You are developing an AI-powered document-processing application. The application is packaged as a Docker image and must be deployed to Azure App Service.

The development team wants App Service to retrieve the image from Azure Container Registry (ACR).

Which configuration is required?

A. Configure the App Service container settings to use the ACR image and provide the required registry authentication
B. Create an Azure Service Bus subscription between ACR and App Service
C. Configure an Event Grid subscription that automatically converts the image into an App Service package
D. Store the Docker image in Azure Blob Storage and configure App Service to mount the blob

Answer: A

Explanation: Azure App Service can run containerized applications using images stored in a container registry such as ACR. The App Service must be configured with the appropriate container image and registry authentication. A Service Bus subscription or Event Grid subscription is not required simply to deploy the image.


Question 2 — Single Answer

A development team wants to automatically build a container image whenever source code is committed. They want the container image to be built directly within Azure without maintaining a dedicated build server.

Which Azure Container Registry capability should you use?

A. ACR replication
B. Azure Container Registry Tasks
C. Azure Container Apps revisions
D. AKS Jobs

Answer: B

Explanation: Azure Container Registry Tasks can automate container image builds and related tasks. They can build images in Azure and can be integrated with source-control or registry workflows. This eliminates the need to maintain a dedicated build environment for the image-building process.


Question 3 — Scenario-Based, Single Answer

A company deploys an AI inference API to Azure Container Apps.

The application receives normal traffic throughout the day, but occasionally receives bursts of messages from an Azure messaging system. The company wants the number of application instances to automatically increase based on the number of pending messages.

Which capability should you use?

A. Container Apps revision traffic splitting
B. Azure App Service autoscale rules based on CPU
C. Kubernetes Event-driven Autoscaling (KEDA)
D. Azure Container Registry Tasks

Answer: C

Explanation: Azure Container Apps supports event-driven scaling through KEDA. KEDA allows scaling decisions to be based on external event sources, such as message queues, rather than relying solely on CPU or memory utilization.


Question 4 — Multiple Answers

You are troubleshooting an application running in Azure Container Apps.

Which two actions can help diagnose application problems?

A. Inspect application logs
B. Inspect container/application events
C. Change the Cosmos DB consistency level
D. Create a Service Bus topic

Answers: A, B

Explanation: Container Apps troubleshooting can involve examining logs and events associated with the application and its containers. Changing Cosmos DB consistency or creating a Service Bus topic does not directly diagnose a Container Apps deployment problem.


Question 5 — Matching

Match each Azure container technology or feature with the most appropriate description.

TechnologyDescription
1. Azure Container RegistryA. Serverless container hosting with application revisions
2. Azure Container AppsB. Managed container image registry
3. AKSC. Managed Kubernetes orchestration
4. KEDAD. Event-driven autoscaling

Answer:

  • 1 → B
  • 2 → A
  • 3 → C
  • 4 → D

Explanation: ACR provides container image storage and management; Container Apps provides managed application hosting for containers; AKS provides managed Kubernetes; and KEDA provides event-driven autoscaling capabilities used by Container Apps.


Question 6 — Single Answer

You have deployed an application to AKS using a Kubernetes manifest.

The application starts successfully, but users cannot reach it through the expected endpoint.

Which approach should you take first to investigate the problem?

A. Rebuild the container image using ACR Tasks
B. Increase the Cosmos DB RU/s limit
C. Inspect Kubernetes resources, events, logs, and connectivity configuration
D. Create an Event Grid custom topic

Answer: C

Explanation: Microsoft specifically identifies monitoring and troubleshooting AKS applications through logs, events, and end-to-end connectivity as part of the AI-200 skill set. A deployment can succeed while networking, service, ingress, or application configuration prevents clients from reaching the application.


Question 7 — Single Answer

A new version of a containerized AI API is deployed to Azure Container Apps. The team wants to test the new version without immediately sending all production traffic to it.

Which Container Apps capability is most appropriate?

A. Container Apps revisions
B. ACR Tasks
C. Kubernetes DaemonSets
D. Azure Functions bindings

Answer: A

Explanation: Azure Container Apps supports revisions, allowing different versions of an application to be deployed and managed independently. Traffic can then be managed between revisions, supporting controlled rollout scenarios.


Section 2 — Develop AI Solutions Using Azure Data Management Services

Questions 8–15


Question 8 — Single Answer

An AI application uses Azure Cosmos DB for NoSQL to store documents and their embeddings.

The application needs to retrieve documents whose embeddings are semantically similar to a query embedding.

Which capability should the application use?

A. Change feed
B. Vector similarity search
C. Azure Functions timer trigger
D. Event Grid retry policy

Answer: B

Explanation: Azure Cosmos DB for NoSQL supports storing embeddings and performing vector similarity search. This capability is useful for semantic retrieval and AI/RAG scenarios.


Question 9 — Scenario-Based, Single Answer

An application frequently queries a Cosmos DB for NoSQL container using a property called category.

The query workload has grown significantly, and the development team wants to reduce unnecessary RU consumption by ensuring frequently queried properties are indexed appropriately.

What should the team investigate?

A. Cosmos DB indexing policy
B. Azure Service Bus lock duration
C. Container Apps revision settings
D. Azure Key Vault rotation policy

Answer: A

Explanation: Cosmos DB indexing policies affect how queries are executed and can influence RU consumption and query performance. Designing an appropriate indexing policy is an important part of optimizing Cosmos DB workloads.


Question 10 — Multiple Answers

An AI application uses Azure Cosmos DB for NoSQL.

Which two capabilities are directly relevant to implementing AI retrieval workflows?

A. Storing embeddings
B. Performing vector similarity searches
C. Creating App Service deployment slots
D. Configuring Service Bus dead-letter queues

Answers: A, B

Explanation: Cosmos DB for NoSQL can store embeddings and perform vector similarity searches. These capabilities support semantic retrieval and RAG-style AI applications.


Question 11 — Single Answer

A document-processing application needs to react whenever new or updated items are written to an Azure Cosmos DB for NoSQL container.

Which Cosmos DB capability is designed for this purpose?

A. Analytical store
B. Change feed
C. Vector index
D. Consistency policy

Answer: B

Explanation: The Cosmos DB change feed provides an ordered record of changes to items in a container and can be used to detect and process new or updated items. The AI-200 study guide explicitly includes implementing a change feed processor.


Question 12 — Fill in the Blank

Complete the statement:

Azure Database for PostgreSQL can support vector similarity search for AI workloads by using the __________ extension.

Answer: pgvector

Explanation: PostgreSQL AI workloads can use the pgvector extension to store and search vector embeddings. Microsoft specifically identifies Azure Database for PostgreSQL with pgvector as an AI data service covered by the course and exam.


Question 13 — Scenario-Based, Single Answer

A company is implementing a RAG application using Azure Database for PostgreSQL.

Each document chunk contains:

  • an embedding
  • document text
  • a tenant ID
  • a document type

The application must retrieve semantically similar chunks but only from the current tenant.

What should the application implement?

A. Vector similarity search combined with metadata filtering
B. A Service Bus subscription filtered by tenant ID
C. An Azure Function timer trigger
D. A Redis expiration policy

Answer: A

Explanation: Vector similarity search retrieves semantically related records, while metadata filtering restricts the result set to relevant records such as a particular tenant. The AI-200 study guide specifically calls out semantic retrieval and RAG patterns using metadata filters with PostgreSQL.


Question 14 — Single Answer

An AI application performs expensive vector searches against Azure Database for PostgreSQL.

The team wants to reduce vector-search latency and unnecessary computational overhead.

Which area should they investigate?

A. Azure Event Grid retry policies
B. pgvector indexing and query optimization
C. App Configuration feature flags
D. Service Bus dead-letter queues

Answer: B

Explanation: PostgreSQL vector workloads can be optimized through appropriate indexing strategies and pgvector configuration. Microsoft specifically includes optimizing vector search and reducing pgvector compute overhead in the AI-200 objectives.


Question 15 — Matching

Match each Azure data technology with the most appropriate use case.

TechnologyUse case
1. Cosmos DB for NoSQLA. Distributed document storage and vector search
2. Azure Database for PostgreSQLB. Relational data and pgvector-based AI workloads
3. Azure Managed RedisC. Low-latency caching and vector storage/search
4. Cosmos DB change feedD. Detecting new or updated Cosmos DB items

Answer:

  • 1 → A
  • 2 → B
  • 3 → C
  • 4 → D

Explanation: These are distinct but complementary AI data patterns. Cosmos DB supports NoSQL document workloads and vector search; PostgreSQL supports relational workloads and pgvector; Azure Managed Redis supports caching and vector capabilities; and Cosmos DB change feed supports processing item changes.


Section 3 — Connect to and Consume Azure Services

Questions 16–23


Question 16 — Single Answer

An AI application submits long-running document-processing requests.

The API should return quickly rather than waiting for processing to finish. A backend worker should process the requests asynchronously.

Which Azure service is most appropriate for queuing the work?

A. Azure Key Vault
B. Azure Service Bus
C. Azure App Configuration
D. Azure Container Registry

Answer: B

Explanation: Azure Service Bus provides messaging capabilities appropriate for decoupling producers from consumers and processing backend operations asynchronously. The AI-200 objectives specifically include queuing and processing backend operations using Service Bus.


Question 17 — Scenario-Based, Single Answer

An AI application uses Azure Service Bus.

Messages that repeatedly fail processing should be isolated so that they do not continue to interfere with normal message processing.

What should the application use?

A. A dead-letter queue
B. An Event Grid custom topic
C. An App Configuration key
D. A Cosmos DB change feed

Answer: A

Explanation: Azure Service Bus provides dead-letter queues for messages that cannot be successfully processed or that meet specified dead-lettering conditions. This allows problematic messages to be isolated for inspection or later processing.


Question 18 — Multiple Answers

You are designing an AI workflow using Azure Service Bus.

Which two capabilities are directly supported by Service Bus and relevant to the AI-200 objectives?

A. Topics and subscriptions
B. Dead-letter queues
C. Vector similarity search
D. Container image versioning

Answers: A, B

Explanation: The AI-200 study guide explicitly includes Service Bus messages, topics, subscriptions, and dead-letter queue handling. Vector search and container image versioning are handled by other Azure services.


Question 19 — Single Answer

A company wants an application to react whenever a new image is added to an Azure Storage account.

The workflow should be event-driven rather than continuously polling the storage account.

Which Azure service should be used to route the event?

A. Azure Event Grid
B. Azure Key Vault
C. Azure Managed Redis
D. Azure Container Registry Tasks

Answer: A

Explanation: Event Grid is designed for event-driven architectures. It can route events from Azure resources to handlers and supports event filtering and retry behavior.


Question 20 — Scenario-Based, Single Answer

An AI application needs a lightweight HTTP API that performs a small amount of processing and then returns a response.

The API does not require a continuously running server.

Which Azure service is most appropriate?

A. Azure Kubernetes Service
B. Azure Functions
C. Azure Container Registry
D. Azure Service Bus

Answer: B

Explanation: Azure Functions provides serverless execution and supports HTTP-triggered functions that can implement APIs without requiring developers to manage a continuously running server infrastructure. The AI-200 objectives include building serverless APIs using triggers and bindings.


Question 21 — Single Answer

You are developing an Azure Function that should execute whenever a message arrives in a supported messaging system.

Which Azure Functions capability determines what causes the function to execute?

A. Binding
B. Trigger
C. Revision
D. Indexing policy

Answer: B

Explanation: A Function trigger defines the event that causes a function to execute. Bindings provide a declarative way to connect a function to input and output data or services.


Question 22 — Multiple Answers

Which two statements correctly describe Azure Functions concepts?

A. A trigger determines when a function executes.
B. Bindings can simplify interaction with external data or services.
C. A trigger is primarily used to create a PostgreSQL vector index.
D. Bindings replace all Azure authentication mechanisms.

Answers: A, B

Explanation: Triggers define function execution events, while bindings provide connections to data and services. They do not create database indexes or eliminate the need for authentication and authorization.


Question 23 — Scenario-Based, Single Answer

An organization publishes custom business events for its AI workflow. Several downstream applications should independently receive the events.

The organization also needs to apply event filters so that each subscriber receives only the events relevant to it.

Which Azure service is the best fit?

A. Azure Service Bus queue
B. Azure Event Grid
C. Azure Key Vault
D. Azure App Service

Answer: B

Explanation: Event Grid is designed for event-driven architectures and supports custom events and event filtering. It is appropriate when publishers emit events and multiple subscribers independently react to those events.


Section 4 — Secure, Monitor, and Troubleshoot Azure Solutions

Questions 24–30


Question 24 — Single Answer

An AI application requires an API key to access an external AI service.

The development team currently stores the key directly in the application’s source code.

What is the best Azure-native solution?

A. Store the key in Azure Container Registry
B. Store the key in Azure App Configuration as plain text
C. Store the key in Azure Key Vault
D. Store the key in an Azure Service Bus message

Answer: C

Explanation: Azure Key Vault is designed to securely store and retrieve secrets such as API keys, passwords, and other sensitive configuration information. Hard-coding secrets in source code should be avoided.


Question 25 — Scenario-Based, Single Answer

A company wants to change application configuration values without rebuilding and redeploying the application.

The configuration includes feature flags and non-secret application settings.

Which service should be used?

A. Azure App Configuration
B. Azure Key Vault
C. Azure Container Registry
D. Azure Service Bus

Answer: A

Explanation: Azure App Configuration provides centralized management of application settings and configuration. Key Vault is primarily intended for secrets and other sensitive values.


Question 26 — Multiple Answers

A company is designing secure configuration management for an AI application.

Which two approaches are appropriate?

A. Store sensitive secrets in Azure Key Vault.
B. Store application configuration information in Azure App Configuration.
C. Store API secrets directly in application source code.
D. Put database passwords into Event Grid event payloads.

Answers: A, B

Explanation: Key Vault is designed for secrets, while App Configuration provides centralized application configuration management. Secrets should not be embedded in source code or unnecessarily exposed in event payloads.


Question 27 — Single Answer

An AI application consists of multiple distributed services.

A request enters an API, invokes a backend service, calls a database, and then invokes another service.

The development team needs to follow the request across these components to identify where latency is occurring.

Which technology should they use?

A. Azure Container Registry Tasks
B. OpenTelemetry
C. Cosmos DB indexing
D. Service Bus dead-lettering

Answer: B

Explanation: OpenTelemetry provides standardized application instrumentation for collecting telemetry such as traces, metrics, and related diagnostic information. Distributed tracing can help follow a request across multiple services.


Question 28 — Scenario-Based, Single Answer

You need to analyze application logs stored in Azure Monitor Logs.

You want to find all requests where the duration was greater than 2 seconds and return the most recent results first.

Which technology should you use?

A. Dockerfile
B. KQL
C. pgvector
D. KEDA

Answer: B

Explanation: Kusto Query Language (KQL) is used to query and analyze data in Azure Monitor Logs and other Azure data platforms. The AI-200 study guide explicitly includes writing KQL queries to analyze logs and metrics.


Question 29 — Matching

Match each technology with its primary purpose.

TechnologyPurpose
1. Azure Key VaultA. Centralized application configuration
2. Azure App ConfigurationB. Secure secret management
3. OpenTelemetryC. Application telemetry and distributed tracing
4. KQLD. Query and analyze telemetry/log data

Answer:

  • 1 → B
  • 2 → A
  • 3 → C
  • 4 → D

Explanation: Key Vault handles secrets, App Configuration manages application settings, OpenTelemetry provides instrumentation and telemetry, and KQL is used to query and analyze telemetry and log data.


Question 30 — Scenario-Based, Single Answer

An AI application is experiencing intermittent performance problems.

The application consists of several microservices running in Azure. Users report that some requests take several seconds to complete, but CPU utilization on the individual services does not consistently appear high.

The development team wants to determine which downstream service is contributing to the latency for individual requests.

Which approach is most appropriate?

A. Enable distributed tracing with OpenTelemetry
B. Increase the Cosmos DB consistency level
C. Create an additional Azure Container Registry
D. Configure a Service Bus dead-letter queue

Answer: A

Explanation: Distributed tracing is particularly valuable when an application spans multiple services. OpenTelemetry instrumentation can provide trace information that helps developers follow a request across service boundaries and identify where latency is introduced.


Go to the AI-200 Exam Prep Hub main page

Write KQL queries to analyze logs and metrics (AI-200 Exam Prep)

This post is a part of the AI-200: Developing AI Cloud Solutions on Azure  Exam Prep Hub.
This topic falls under these sections:
Secure, monitor, and troubleshoot Azure solutions (20–25%)
   --> Monitor and troubleshoot Azure solutions
      --> Write KQL queries to analyze logs and metrics


Note that there are 10 practice questions (with answers) at the end of each section to help you solidify your knowledge of the material. Also, there are 4 practice tests with 30 questions each available from the hub's main page below the exam topics section.

Overview

Azure applications generate large amounts of telemetry, including application logs, resource logs, requests, dependencies, exceptions, performance information, and metrics. For an AI cloud developer, being able to turn this telemetry into useful information is an important troubleshooting and monitoring skill.

Kusto Query Language (KQL) is the query language used by Azure Monitor Logs and Log Analytics. It is designed for querying and analyzing large volumes of structured and semi-structured data. KQL is also used across several Microsoft services, including Azure Monitor, Azure Data Explorer, Microsoft Fabric, and Microsoft Sentinel.

For the AI-200 exam, you should be comfortable reading and writing KQL queries that:

  • Filter log records
  • Select and rename columns
  • Sort results
  • Limit returned records
  • Create calculated columns
  • Aggregate data
  • Group results
  • Analyze data over time
  • Identify errors and exceptions
  • Analyze application performance
  • Join or combine related data
  • Create time-series visualizations
  • Investigate trends and anomalies
  • Analyze telemetry from distributed applications

1. What Is Kusto Query Language?

Kusto Query Language (KQL) is a read-only query language optimized for analyzing large datasets.

A KQL query generally starts with a table and then applies a sequence of operations to that table.

For example:

AzureActivity
| where TimeGenerated > ago(1h)
| where ActivityStatus == "Failed"
| project TimeGenerated, OperationNameValue, ActivityStatus

The pipe character (|) passes the output of one operation to the next.

Conceptually:

Table
↓
Filter
↓
Filter
↓
Select columns
↓
Results

This pipeline-oriented approach is one of the most important characteristics of KQL.

KQL queries are read-only. They retrieve and analyze data rather than modifying the underlying records.


2. Azure Monitor Logs and Log Analytics

Azure Monitor Logs stores telemetry in a Log Analytics workspace.

Log Analytics is one of the primary tools used in the Azure portal to write and execute KQL queries.

The general relationship is:

Azure Resources / Applications
↓
Azure Monitor
↓
Diagnostic data
↓
Log Analytics Workspace
↓
KQL
↓
Analysis / Alerts /
Workbooks / Reports

Resource logs aren’t automatically available in a Log Analytics workspace simply because the resource exists. A diagnostic setting generally needs to be configured to send resource logs to the workspace.

KQL queries can subsequently be used for troubleshooting, analysis, dashboards, alerts, and reporting.


3. Understanding the Basic KQL Query Structure

A simple KQL query looks like this:

TableName
| operator
| operator
| operator

For example:

AppRequests
| where TimeGenerated > ago(1h)
| where Success == false
| project TimeGenerated, Name, ResultCode

Each line operates on the results produced by the previous line.

Important exam concept

KQL isn’t SQL.

For example:

SQL:

SELECT Name, ResultCode
FROM AppRequests
WHERE Success = 0;

KQL:

AppRequests
| where Success == false
| project Name, ResultCode

The order and syntax are different.


4. The where Operator

The where operator filters records.

AppRequests
| where Success == false

This returns only unsuccessful requests.

Multiple conditions can be combined:

AppRequests
| where Success == false
| where ResultCode == 500

Or:

AppRequests
| where Success == false and ResultCode == 500

You can also use or:

AppRequests
| where ResultCode == 500 or ResultCode == 503

Common comparison operators

OperatorMeaning
==Equals
!=Not equal
>Greater than
<Less than
>=Greater than or equal
<=Less than or equal
containsContains text
startswithStarts with text
endswithEnds with text
inMatches one of several values

Example:

AppRequests
| where ResultCode in (500, 502, 503)

5. Filtering by Time

Time filtering is extremely important when troubleshooting.

A common approach is the ago() function.

AppRequests
| where TimeGenerated > ago(1h)

This means:

Return records generated within the last hour.

Other examples:

| where TimeGenerated > ago(30m)
| where TimeGenerated > ago(24h)
| where TimeGenerated > ago(7d)

You can also specify explicit timestamps:

| where TimeGenerated between (
datetime(2026-08-10 08:00:00) ..
datetime(2026-08-10 12:00:00)
)

Exam tip

When investigating an incident, filtering by time early is usually a good practice because it reduces the amount of data being processed and makes the results easier to interpret.


6. The project Operator

Use project to select the columns you want returned.

AppRequests
| project TimeGenerated, Name, ResultCode

Instead of returning every available column, the query returns only the selected columns.

You can also rename columns:

AppRequests
| project Timestamp = TimeGenerated, Endpoint = Name, Status = ResultCode

This is particularly useful when creating clean results for reports or troubleshooting.


7. The project-away Operator

project-away removes columns from the result.

For example:

AppRequests
| project-away Computer, TenantId

This can be useful when you want most columns but need to exclude a few.


8. The extend Operator

extend creates a calculated column.

For example:

AppRequests
| extend DurationSeconds = DurationMs / 1000.0
| project Name, DurationMs, DurationSeconds

The original columns remain available, and the calculated column is added to the result.

Another example:

AppRequests
| extend IsSlow = DurationMs > 2000

Now each record has an IsSlow value indicating whether the request exceeded two seconds.

extend vs. project

This distinction is important:

  • extend adds or calculates columns.
  • project controls which columns appear in the final result.

They are frequently used together.


9. The summarize Operator

summarize performs aggregations.

For example:

AppRequests
| summarize count()

This returns the number of records.

You can calculate averages:

AppRequests
| summarize avg(DurationMs)

Other common aggregation functions include:

FunctionPurpose
count()Number of records
sum()Sum
avg()Average
min()Minimum
max()Maximum
dcount()Approximate distinct count
countif()Count records meeting a condition
sumif()Sum values meeting a condition
avgif()Average values meeting a condition

10. Grouping with summarize

You can group results using by.

For example:

AppRequests
| summarize count() by ResultCode

This produces a count for each result code.

You can also group by multiple columns:

AppRequests
| summarize count() by Name, ResultCode

This is similar conceptually to a GROUP BY operation in SQL.


11. Conditional Aggregations

KQL’s conditional aggregation functions are particularly useful for monitoring.

For example:

AppRequests
| summarize
TotalRequests = count(),
FailedRequests = countif(Success == false)

You could calculate an error rate:

AppRequests
| summarize
TotalRequests = count(),
FailedRequests = countif(Success == false)
| extend ErrorRate = 100.0 * FailedRequests / TotalRequests

This is an excellent example of using KQL to turn raw telemetry into a meaningful application-health metric.


12. Sorting Results

Use order by or sort by to sort results.

AppRequests
| order by DurationMs desc

This puts the slowest requests first.

You can sort ascending:

AppRequests
| order by DurationMs asc

Troubleshooting example

To find the slowest requests:

AppRequests
| where TimeGenerated > ago(1h)
| order by DurationMs desc
| take 20

This returns the 20 slowest requests from the last hour.


13. Limiting Results with take

Use take to return a specified number of records.

AppRequests
| take 10

For troubleshooting:

AppExceptions
| where TimeGenerated > ago(30m)
| take 50

take is particularly useful when exploring an unfamiliar table.


14. The distinct Operator

Use distinct to return unique values.

AppRequests
| distinct Name

You can use multiple columns:

AppRequests
| distinct Name, ResultCode

This is useful for understanding the values contained in a dataset.


15. Searching Text

KQL provides several operators for text analysis.

For example:

AppExceptions
| where OuterMessage contains "timeout"

You can also use:

AppRequests
| where Name startswith "/api/"

And:

AppRequests
| where Name endswith "/health"

The has operator can also be useful for term-based searches:

AppExceptions
| where OuterMessage has "timeout"

Understanding the difference between text-search operators can matter when troubleshooting log data.


16. Working with Null and Empty Values

Use isnull() and isnotnull() when checking for null values.

AppRequests
| where isnull(UserId)

Or:

AppRequests
| where isnotnull(UserId)

For strings, isempty() and isnotempty() can be useful.

AppRequests
| where isnotempty(Name)

17. Binning Data with bin()

When analyzing data over time, you often don’t want every individual event.

Instead, you can group events into time intervals.

For example:

AppRequests
| summarize count() by bin(TimeGenerated, 5m)

This produces request counts in five-minute intervals.

You can use different intervals:

bin(TimeGenerated, 1m)
bin(TimeGenerated, 1h)
bin(TimeGenerated, 1d)

This is one of the most important techniques for creating time-series analyses.


18. Creating Time-Series Charts

A typical query might be:

AppRequests
| summarize RequestCount = count()
by bin(TimeGenerated, 5m)
| render timechart

The query:

  1. Counts requests.
  2. Groups them into five-minute intervals.
  3. Produces a time-series visualization.

Azure Monitor’s Metrics and log-based analysis commonly use this type of time-binning approach.


19. Analyzing Errors Over Time

Suppose an application is experiencing intermittent failures.

You could use:

AppRequests
| where TimeGenerated > ago(24h)
| summarize
TotalRequests = count(),
FailedRequests = countif(Success == false)
by bin(TimeGenerated, 15m)
| extend ErrorRate = 100.0 * FailedRequests / TotalRequests
| render timechart

This allows you to see whether error rates are increasing, decreasing, or occurring in bursts.


20. Finding the Most Common Errors

For exception analysis:

AppExceptions
| where TimeGenerated > ago(24h)
| summarize Count = count() by OuterMessage
| order by Count desc
| take 20

This identifies the most frequently occurring exception messages.

A developer could then investigate whether the most common exception corresponds to a particular application component or deployment.


21. Analyzing HTTP Status Codes

A useful troubleshooting query is:

AppRequests
| where TimeGenerated > ago(1h)
| summarize Count = count() by ResultCode
| order by Count desc

To focus specifically on server errors:

AppRequests
| where TimeGenerated > ago(1h)
| where ResultCode startswith "5"
| summarize Count = count() by ResultCode
| order by Count desc

This can help identify whether an application is experiencing widespread 5xx failures.


22. Identifying Slow Requests

A simple performance query:

AppRequests
| where TimeGenerated > ago(1h)
| where DurationMs > 2000
| project TimeGenerated, Name, DurationMs, ResultCode
| order by DurationMs desc

This finds requests taking more than two seconds.

You can instead summarize performance by endpoint:

AppRequests
| summarize
AverageDuration = avg(DurationMs),
MaximumDuration = max(DurationMs),
RequestCount = count()
by Name
| order by AverageDuration desc

This helps identify endpoints that consistently perform poorly.


23. Counting Distinct Users

The dcount() function provides an approximate distinct count.

For example:

AppRequests
| summarize UniqueUsers = dcount(UserId)

This is often useful for telemetry where an exact distinct count isn’t required.

For example:

AppRequests
| summarize UniqueUsers = dcount(UserId)
by bin(TimeGenerated, 1h)
| render timechart

24. Joining Data

Sometimes the information needed to investigate a problem is stored in multiple tables.

KQL supports operations such as join.

Conceptually:

TableA
| join kind=inner TableB on SomeColumn

For example, you might correlate application records with another dataset containing additional information.

The join operator combines rows from two tables based on matching values.

Important exam consideration

Don’t automatically use join simply because two datasets exist. First determine whether the required information can be obtained from a single table.

Also remember that Azure Monitor has some KQL differences and limitations compared with Azure Data Explorer. For example, certain cross-cluster functionality isn’t supported in Azure Monitor.


25. The union Operator

union combines data from multiple tables or datasets.

Conceptually:

union TableA, TableB

This is useful when similar telemetry exists in multiple tables.

For example, Application Insights telemetry can be analyzed across multiple telemetry tables.


26. Working with Application Insights Telemetry

Application Insights provides application telemetry such as:

  • Requests
  • Dependencies
  • Exceptions
  • Traces
  • Page views
  • Availability results
  • Custom events
  • Custom metrics

For example, you can examine requests:

requests
| where timestamp > ago(1h)
| summarize count() by resultCode

Or exceptions:

exceptions
| where timestamp > ago(1h)
| summarize count() by type
| order by count_ desc

The exact tables and schema depend on the telemetry architecture and Azure Monitor/Application Insights configuration being used, so the ability to inspect the available table schema is important.


27. Logs Versus Metrics

A key concept for AI-200 is understanding that logs and metrics are complementary.

Metrics

Metrics are typically numerical measurements designed for efficient monitoring and alerting.

Examples include:

  • CPU percentage
  • Request count
  • Memory utilization
  • Network traffic
  • Latency

Logs

Logs provide detailed records about events and operations.

Examples include:

  • Exceptions
  • HTTP requests
  • Dependency calls
  • Resource operations
  • Application traces
  • Security events

A metric might tell you:

Error rate increased to 12%.

A log query can help answer:

Which endpoint is failing, what exception is occurring, and which dependency is involved?

Azure Monitor supports working with both metrics and logs, and log-based metrics can themselves be represented through KQL queries.


28. Querying Resource Logs

Azure resources can send resource logs to Log Analytics through diagnostic settings.

Once the logs are available, KQL can be used to analyze them.

For example:

AzureActivity
| where TimeGenerated > ago(1h)
| summarize count() by Category

Or:

AzureActivity
| where TimeGenerated > ago(24h)
| where ActivityStatus == "Failed"
| project TimeGenerated, OperationNameValue, ActivityStatus

The exact table and fields depend on the Azure service and diagnostic configuration.


29. Using render

The render operator specifies how query results should be visualized.

For example:

AppRequests
| summarize count() by bin(TimeGenerated, 5m)
| render timechart

Other visualization types can be used depending on the data and analysis.

The important exam concept is that render affects how results are displayed, not how the underlying records are filtered or aggregated.


30. Detecting Anomalies

KQL includes capabilities for time-series analysis and anomaly detection.

For example, a time series can be created using make-series.

KQL also provides functions and operators that can be used for anomaly detection and forecasting. Azure Monitor documents these capabilities for analyzing telemetry without having to export the data to an external machine-learning system.

For AI-200, understand the general purpose:

Use KQL time-series capabilities to identify unusual behavior in application or infrastructure telemetry.


31. Example: Detecting an Increase in Errors

A practical investigation might proceed in stages.

Step 1 – Determine whether errors are occurring

AppRequests
| where TimeGenerated > ago(24h)
| where Success == false
| summarize count()

Step 2 – Determine when they occurred

AppRequests
| where TimeGenerated > ago(24h)
| where Success == false
| summarize count() by bin(TimeGenerated, 15m)
| render timechart

Step 3 – Identify the failing endpoints

AppRequests
| where TimeGenerated > ago(24h)
| where Success == false
| summarize count() by Name
| order by count_ desc

Step 4 – Identify the status codes

AppRequests
| where TimeGenerated > ago(24h)
| where Success == false
| summarize count() by ResultCode
| order by count_ desc

This demonstrates a very useful troubleshooting methodology:

Detect → locate → categorize → investigate


32. Example: Investigating a Slow AI Application

Suppose an AI application suddenly becomes slow.

You could start with:

AppRequests
| where TimeGenerated > ago(1h)
| summarize
AverageDuration = avg(DurationMs),
MaximumDuration = max(DurationMs),
Requests = count()

Then identify slow endpoints:

AppRequests
| where TimeGenerated > ago(1h)
| summarize
AverageDuration = avg(DurationMs)
by Name
| order by AverageDuration desc

Then examine individual slow requests:

AppRequests
| where TimeGenerated > ago(1h)
| where DurationMs > 5000
| project TimeGenerated, Name, DurationMs, ResultCode
| order by DurationMs desc

Finally, investigate dependencies associated with those requests.

This type of correlation is especially useful in distributed AI applications where an API might call several backend services.


33. Query Performance and Cost

KQL can process very large datasets, but query design still matters.

Good practices include:

Filter early

Prefer:

AppRequests
| where TimeGenerated > ago(1h)
| where Success == false
| summarize count() by Name

rather than processing an unnecessarily large historical dataset.

Select only required columns

Use:

| project TimeGenerated, Name, ResultCode

when you don’t need every column.

Use appropriate time ranges

Don’t query seven days of telemetry when the incident occurred five minutes ago.

Aggregate when appropriate

Instead of returning millions of individual records:

| summarize count() by Name

may provide the information you actually need.

This is especially relevant when working with billable data and large workspaces.


34. Querying Basic and Auxiliary Logs

Azure Monitor supports different table plans, including Analytics, Basic, and Auxiliary tables.

There are additional query limitations for Basic and Auxiliary tables. For example, certain multi-table operations aren’t supported, and Basic table queries are limited to a single table in relevant scenarios. Query costs can also depend on the amount of data scanned.

For the exam, understand that not every KQL query capability is necessarily available against every type of Azure Monitor log table.


35. Running KQL Programmatically

KQL isn’t limited to the Azure portal.

The Azure Monitor Logs Query API allows applications and automation tools to execute KQL queries against a Log Analytics workspace. The API accepts a KQL query and optional time range and returns the query results.

For example, conceptually:

{
"query": "AzureActivity | summarize count() by Category",
"timespan": "PT12H"
}

This makes it possible to build custom monitoring applications and automation around Azure Monitor data.


36. Important KQL Operators for AI-200

You should be familiar with at least the following:

Operator/functionPurpose
whereFilter records
projectSelect columns
project-awayRemove columns
extendAdd calculated columns
summarizeAggregate data
order bySort records
takeLimit records
distinctReturn unique values
joinCombine related datasets
unionCombine datasets
renderVisualize results
count()Count records
countif()Conditional count
avg()Average
sum()Sum
min()Minimum
max()Maximum
dcount()Approximate distinct count
bin()Group values into intervals
ago()Calculate a relative time
isnull()Test for null
isnotnull()Test for non-null
containsSearch for text
hasSearch for a term
inMatch against a list

37. KQL Exam Tips

For AI-200, focus on understanding why an operator is used rather than simply memorizing syntax.

Remember:

where = filter

| where Status == "Failed"

project = choose columns

| project TimeGenerated, Status

extend = calculate/add columns

| extend DurationSeconds = DurationMs / 1000

summarize = aggregate

| summarize count() by Status

order by = sort

| order by DurationMs desc

take = limit rows

| take 10

bin = group into intervals

| summarize count() by bin(TimeGenerated, 5m)

render = visualize

| render timechart

A particularly important pattern is:

TABLE
→ where
→ extend/project
→ summarize
→ order
→ render

38. Putting It All Together

Consider this query:

AppRequests
| where TimeGenerated > ago(24h)
| where Success == false
| summarize
FailedRequests = count()
by bin(TimeGenerated, 30m), Name
| order by TimeGenerated asc
| render timechart

This query:

  1. Starts with AppRequests.
  2. Limits the analysis to the last 24 hours.
  3. Keeps unsuccessful requests.
  4. Groups failures into 30-minute intervals.
  5. Separates them by endpoint name.
  6. Sorts the results chronologically.
  7. Creates a time-series visualization.

Understanding how each stage transforms the data is exactly the type of reasoning that can help with AI-200 scenario-based questions.


39. Key Takeaways

For the “Write KQL queries to analyze logs and metrics” topic, make sure you can:

  • Explain what KQL is.
  • Explain the role of Log Analytics and Azure Monitor Logs.
  • Understand KQL’s pipeline syntax.
  • Filter records with where.
  • Select columns with project.
  • Create calculated values with extend.
  • Aggregate records with summarize.
  • Group data with by.
  • Sort results with order by.
  • Limit results with take.
  • Find unique values with distinct.
  • Filter by relative time using ago().
  • Group time-series data using bin().
  • Calculate counts, averages, sums, minimums, and maximums.
  • Use conditional aggregations such as countif().
  • Analyze errors and exceptions.
  • Analyze request duration and performance.
  • Correlate data using join when appropriate.
  • Combine datasets using union.
  • Create visualizations using render.
  • Understand the relationship between logs and metrics.
  • Understand how diagnostic settings make resource logs available for querying.
  • Recognize that Azure Monitor has some KQL differences and limitations compared with Azure Data Explorer.
  • Understand how KQL can be executed programmatically through the Azure Monitor Logs Query API.

Practice Exam Questions

Question 1

An AI-powered web application is experiencing intermittent HTTP 500 errors. You need to determine how many failed requests occurred during each 10-minute interval during the last hour.

Which KQL query should you use?

A.

AppRequests
| where TimeGenerated > ago(1h)
| where ResultCode == 500
| summarize count() by bin(TimeGenerated, 10m)

B.

AppRequests
| where TimeGenerated > ago(10m)
| summarize count() by ResultCode

C.

AppRequests
| summarize count() by TimeGenerated
| where ResultCode == 500

D.

AppRequests
| project ResultCode
| take 10

Answer: A

Explanation

where filters the data to the desired time period and status code. summarize count() counts the records, while bin(TimeGenerated, 10m) groups the results into 10-minute intervals.


Question 2

You need to identify the 20 slowest API requests made during the last two hours.

Which query should you use?

A.

AppRequests
| summarize avg(DurationMs) by Name
| take 20

B.

AppRequests
| where TimeGenerated > ago(2h)
| order by DurationMs desc
| take 20

C.

AppRequests
| where DurationMs > 20
| summarize count()

D.

AppRequests
| project DurationMs
| order by DurationMs asc

Answer: B

Explanation

The query first restricts the data to the last two hours, sorts individual requests by duration in descending order, and then returns the first 20 records. This identifies the slowest individual requests.


Question 3

An application team wants to calculate the average request duration for each API endpoint.

Which operator should primarily be used?

A. project

B. extend

C. summarize

D. take

Answer: C

Explanation

summarize is the KQL operator used for aggregation. For example:

AppRequests
| summarize AverageDuration = avg(DurationMs) by Name

project selects columns, extend creates calculated columns, and take limits the number of returned records.


Question 4

You need to add a column called DurationSeconds containing the request duration converted from milliseconds to seconds.

Which KQL statement should you use?

A.

| summarize DurationSeconds = DurationMs / 1000

B.

| project DurationSeconds = DurationMs / 1000

C.

| extend DurationSeconds = DurationMs / 1000.0

D.

| where DurationSeconds = DurationMs / 1000

Answer: C

Explanation

extend adds a calculated column while retaining the existing columns. Using 1000.0 also ensures the calculation is performed as a floating-point calculation.


Question 5

An administrator wants to identify the number of failed operations grouped by operation name.

Which query is most appropriate?

A.

AzureActivity
| summarize FailedOperations = countif(ActivityStatus == "Failed")
by OperationNameValue

B.

AzureActivity
| where OperationNameValue == "Failed"
| project ActivityStatus

C.

AzureActivity
| order by ActivityStatus
| take 10

D.

AzureActivity
| distinct OperationNameValue

Answer: A

Explanation

countif() counts records that satisfy a condition, and by OperationNameValue groups the counts by operation. This directly answers the requirement.


Question 6

You are investigating application traffic and want to see request counts in five-minute intervals displayed as a time-series chart.

Which query should you use?

A.

AppRequests
| take 5
| render timechart

B.

AppRequests
| summarize count() by TimeGenerated
| render piechart

C.

AppRequests
| summarize count() by bin(TimeGenerated, 5m)
| render timechart

D.

AppRequests
| project TimeGenerated
| render timechart

Answer: C

Explanation

bin() groups timestamps into five-minute intervals, summarize count() counts requests in each interval, and render timechart produces the time-series visualization.


Question 7

You want to return only the TimeGenerated, Name, and ResultCode columns from a request table.

Which operator should you use?

A. extend

B. project

C. summarize

D. distinct

Answer: B

Explanation

project controls which columns are returned.

For example:

AppRequests
| project TimeGenerated, Name, ResultCode

Question 8

You need to investigate exceptions generated during the previous 30 minutes and display only records where the exception message contains the word “timeout.”

Which query is appropriate?

A.

AppExceptions
| where TimeGenerated > ago(30m)
| where OuterMessage contains "timeout"

B.

AppExceptions
| summarize count() by OuterMessage

C.

AppExceptions
| project TimeGenerated
| take 30

D.

AppExceptions
| order by OuterMessage

Answer: A

Explanation

The first where restricts the data to the previous 30 minutes. The second filters exception messages containing "timeout".


Question 9

An application team wants to determine the approximate number of distinct users who generated requests during each hour.

Which query should you use?

A.

AppRequests
| summarize count(UserId) by bin(TimeGenerated, 1h)

B.

AppRequests
| summarize distinct(UserId) by bin(TimeGenerated, 1h)

C.

AppRequests
| summarize dcount(UserId) by bin(TimeGenerated, 1h)

D.

AppRequests
| distinct UserId
| render timechart

Answer: C

Explanation

dcount() provides an approximate distinct count. Combining it with bin(TimeGenerated, 1h) produces an approximate unique-user count for each hour.


Question 10

An application has experienced a sudden increase in failures. You want to determine whether the failures are concentrated in particular API endpoints and identify the number of failures per endpoint.

Which query is most appropriate?

A.

AppRequests
| take 10

B.

AppRequests
| project Name, Success

C.

AppRequests
| summarize avg(DurationMs) by Name

D.

AppRequests
| where Success == false
| summarize FailureCount = count() by Name
| order by FailureCount desc

Answer: D

Explanation

The query filters for failed requests, groups those failures by endpoint name, counts the failures, and sorts the endpoints from the highest failure count to the lowest. This is an effective way to identify which API endpoints are contributing most to the incident.


Final Exam Perspective

The most important thing to remember for this AI-200 topic is that KQL is fundamentally about turning large volumes of telemetry into actionable information.

A scenario might give you thousands or millions of log records and ask you to determine:

What failed?

Use where.

How many failed?

Use summarize count() or countif().

Where did the failures occur?

Use summarize ... by.

When did they occur?

Use bin() with a timestamp.

Which endpoint is the slowest?

Use summarize avg() or inspect individual records with order by.

What happened during the last hour?

Use ago(1h).

What does the trend look like?

Use time-based summarize and render timechart.

What information do I actually need to see?

Use project.

If you can recognize these patterns quickly, you will be well prepared for the KQL-related scenario questions in AI-200. Azure Monitor’s KQL capabilities are specifically designed for exploring logs, transforming and aggregating telemetry, identifying patterns and anomalies, troubleshooting applications, and supporting alerts and reports.


Go to the AI-200 Exam Prep Hub main page