Chapter 1
Design Identity, Governance, and Monitoring Solutions
This chapter covers the whole of Domain 1: logging and monitoring, authentication and authorization, and governance. AZ-305 is a design exam. Every section asks the same question the exam asks: given these requirements and constraints, which solution should you recommend — and why?
The answer is almost never a product name alone. It is a product, at a scope, with a licence, a retention choice, and a trade-off you can defend.
The company in this book is fictional. It is a mid-sized online training business. It runs its storefront, video platform, and back-office systems on Azure.
It also keeps a small on-premises office network. Every scenario in this chapter is set at the company.
Design vs. administration. An administrator configures a service that already exists. An architect recommends which service, at which scope, under which licence, with which retention and cost trade-offs — before anything is built. AZ-305 tests the second skill. If a question asks how to click through a wizard, you are reading it wrong; it is asking which design decision the wizard should implement.
1.1 Recommend a logging solution
Logging answers one question: when something happened, can we prove what happened, who did it, and in what order?
A logging solution is therefore judged on three things: what it collects, how long it keeps it, and how fast you can query it when it matters.
The Azure logging landscape
Azure produces several distinct log families, and the exam loves to mix them up. Keep them separate in your head:
| Log family | What it records | Where it lives by default | Retention |
|---|---|---|---|
| Activity log | Control-plane operations on subscriptions (who created, deleted, or changed a resource) | Azure Monitor, per subscription | 90 days in the portal; longer only if routed elsewhere |
| Microsoft Entra audit logs | Identity changes (user created, role assigned, group changed) | Entra ID | 7 days (Free), 30 days (P1/P2) |
| Microsoft Entra sign-in logs | Authentication attempts, including failures and risk signals | Entra ID | 7 days (Free), 30 days (P1/P2); risky sign-ins 90 days (P2) |
| Resource logs (diagnostic logs) | Data-plane activity inside a resource (firewall denies, Key Vault access, storage reads) | Nowhere until you enable diagnostic settings | Determined by the destination you choose |
| Microsoft 365 unified audit log | Mailbox, SharePoint, and Teams activity | Microsoft Purview | Separate from Entra logs; managed in Purview |
The single most-tested logging fact in this domain: resource logs are not collected until you enable diagnostic settings. A candidate who assumes Key Vault or a firewall "logs by default" will pick the wrong answer. Platform metrics are automatic; resource logs are opt-in.
Log Analytics workspaces
A Log Analytics workspace is the central store for Azure Monitor logs. It is where logs become queryable with Kusto Query Language (KQL), where alert rules run, and where Microsoft Sentinel sits. Design decisions about a workspace are about scope, retention, and cost:
- • Scope: one workspace per region is the usual starting point. A workspace lives in one region, and data residency follows it. Large estates split workspaces by environment (production vs. non-production) or by business unit. They use cross-workspace queries or Azure Lighthouse for central viewing, rather than forcing everything into one workspace.
- • Retention: by default, tables in a Log Analytics workspace retain data for 30 days. Interactive (Analytics) retention can be extended to up to 730 days. Total retention, including long-term archive, can reach up to 12 years. The
UsageandAzureActivitytables keep data for at least 90 days at no charge. Retention is not retroactive — raising it today does not recover data that already expired. - • Cost: ingestion and retention dominate cost. The design lever is not "collect less" in the abstract. It is table-level retention (keep security tables long, keep noisy verbose tables short), data collection rules that filter at the source, and the Basic/Auxiliary table plans for high-volume, low-value logs.
Metrics are not logs. Metrics are numbers sampled on a schedule (CPU percentage every minute). Platform and custom metrics are stored for 93 days, and you can chart at most 30 days on a single chart. Logs are timestamped records of events, kept in a workspace for as long as you pay to retain them. If the requirement is "show me the exact failed sign-in at 02:14 with the source IP", that is a log question, not a metrics question. If it is "show me CPU over the last month", that is a metrics question. Mixing the two up is the most common design error in this domain.
The company must investigate security incidents up to 180 days after they happen. Its Entra ID sign-in logs are currently only visible for 30 days. What is the missing design element, and what retention should the workspace use?
Answer: Answer: The logs must be routed out of Entra ID into a Log Analytics workspace (or a storage account) before they expire. Entra ID retention is fixed at 30 days on P1/P2 and cannot be extended in place. Set the workspace retention to at least 180 days for the sign-in tables; 30 days is the default and would lose the evidence.
Microsoft Sentinel and long-term retention
When the requirement includes detection, investigation, and incident response — not just storage — the recommendation is Microsoft Sentinel, which is built on a Log Analytics workspace. Sentinel adds analytics rules, incidents, entities, and automation (playbooks).
It is a SIEM, not a log store. Recommending Sentinel when the requirement is only "keep logs for seven years cheaply" is over-engineering. A storage account with archive tier and immutable blobs is the cheaper answer for cold retention.
For retention beyond two years, the pattern is: workspace for interactive querying (up to 730 days), then long-term retention in the workspace (up to 12 years total) or export to a storage account. Archive in a storage account is cheaper per gigabyte but the data is not queryable with KQL until restored.

1.2 Recommend a solution for routing logs
Routing is the decision of where each log goes. Azure gives you three destinations, and the exam tests whether you know which destination fits which requirement.
| Destination | Best for | Limitations |
|---|---|---|
| Log Analytics workspace | Querying with KQL, alerting, Sentinel, workbooks | Retention costs grow with volume; one region per workspace |
| Storage account | Cheap long-term retention, audit archives, immutable blobs for compliance | Not queryable with KQL; retrieval means export and analysis elsewhere |
| Event hub | Streaming to a SIEM or third-party tool, real-time processing | Not a store — data must be consumed or it is lost; needs a consumer |
The routing mechanism is diagnostic settings, configured per resource (or per category). A diagnostic setting picks log categories and metric categories and sends them to one or more destinations. Key design facts:
- Diagnostic settings are per resource, not per subscription — except for the activity log and Entra ID logs, which are configured at subscription or tenant level. At scale, use Azure Policy with a DeployIfNotExists effect. It deploys diagnostic settings automatically to every new resource of a type.
- One resource can have multiple diagnostic settings, so the same logs can go to a workspace for querying and a storage account for archive at the same time.
- • Data collection rules (DCRs) and data collection endpoints (DCEs) are the modern collection path for agents (Azure Monitor Agent) on VMs and for custom logs. A DCR defines what to collect, how to transform it, and where to send it. The older Log Analytics agent was retired in August 2024 — never recommend it for a new design.
When a scenario says "logs must go to our third-party SIEM in real time", the answer is an event hub, not a storage account. When it says "keep audit logs for seven years as cheaply as possible", the answer is a storage account, not a workspace. When it says "the security team must query and alert on the logs", the answer is a Log Analytics workspace. The requirement's verb — stream, archive, or query — picks the destination.
The company's auditors require firewall logs kept for seven years, while the security team needs to query the last 90 days. Name the routing design.
Answer: Answer: Two diagnostic settings (or one setting with two destinations): send the firewall resource logs to a Log Analytics workspace with 90-day retention for querying, and to a storage account for seven-year archive. One destination cannot do both jobs well.
Walkthrough: Route firewall logs to a workspace and a storage account
The company's auditors require firewall logs kept for seven years, while the security team needs to query the last 90 days. This walkthrough creates the routing the CHECK YOURSELF box above recommends: one diagnostic setting with two destinations.
- In the Azure portal, open the firewall resource and select Diagnostic settings under Monitoring.
- Select Add diagnostic setting and give it a name, for example firewall-to-workspace-and-archive.
- Under Logs, select the firewall log categories (application rule, network rule, and DNS proxy logs as needed).
- Select Send to Log Analytics workspace and pick the workspace, then select Archive to a storage account and pick the storage account.
- Select Save, then confirm in the workspace that firewall events arrive and can be queried with KQL.
Table 1.1 — Diagnostic settings blade
| Section | What to look at |
|---|---|
| Resource | Resource name at the top |
| Log categories | List of log categories; with checkboxes |
| Send to Log Analytics workspace | Workspace picker |
| Archive to a storage account | Storage account picker |

Azure CLI — the same steps:
az monitor diagnostic-settings create --resource <firewall-resource-id> --name
firewall-to-workspace-and-archive --workspace <workspace-id> --storage-account
<storage-account-id> --logs '[{"category": "AZFWApplicationRule", "enabled": true},
{"category": "AZFWNetworkRule", "enabled": true}, {"category": "AZFWDnsQuery",
"enabled": true}]'
Expected output:
{
"id": "/subscriptions/<subscription-id>/resourceGroups/rg-prod/providers/Microsoft.
Network/azureFirewalls/<firewall-name>/providers/Microsoft.Insights/
diagnosticSettings/firewall-to-workspace-and-archive",
"logs": [
{ "category": "AZFWApplicationRule", "enabled": true },
{ "category": "AZFWNetworkRule", "enabled": true },
{ "category": "AZFWDnsQuery", "enabled": true }
],
"name": "firewall-to-workspace-and-archive",
"storageAccountId":
"/subscriptions/<subscription-id>/resourceGroups/rg-prod/providers/Microsoft.Storage/
storageAccounts/<storage-account-name>",
"workspaceId": "/subscriptions/<subscription-id>/resourceGroups/rg-prod/providers/
Microsoft.OperationalInsights/workspaces/<workspace-name>"
}
Why this, not that:
| Option | Cost | Scale | Security | Operations | Pick it when |
|---|---|---|---|---|---|
| Log Analytics workspace only | Ingestion per GB; retention per GB/month | One region per workspace; full KQL at scale | Queryable audit trail; Sentinel-ready | One destination; alerting built in | The team must query and alert on the last 90 days |
| Storage account archive only | Cheapest per GB; Archive tier lowest | GRS across regions; no query engine | Immutable blobs for compliance (once a retention policy is set on the container) | Retrieval means export and analyse elsewhere | Seven-year audit archive nobody queries |
| Both (recommended) | Ingestion plus cheap archive storage | Workspace for hot queries, storage for cold retention | Queryable recent logs plus tamper-evident archive | Two destinations in one diagnostic setting | Auditors need 7 years and security needs 90 days of queries |
Worked cost example: Price it in the Azure pricing calculator under Azure Monitor / Log Analytics, region Canada Central. Assume the firewall sends 2 GB of logs a day (60 GB a month).
Analytics Logs pay-as-you-go is $2.30 per GB ingested, with the first 5 GB a month free. Ingestion is (60 − 5) × $2.30 ≈ $126.50 a month.
Interactive retention beyond the free 31 days is about $0.12 per GB per month. 90-day retention on 180 GB stored costs about (180 − 62) × $0.12 ≈ $14.16 a month. That 62 GB assumes 2 GB/day ingestion, so the 31 free days cover 62 GB.
The seven-year archive copy goes to Blob storage: 60 GB a month is 720 GB a year. At the Archive GRS rate of $0.0042 per GB that is about $3.02 a month per year of archive. Total for this walkthrough's resources: roughly $144 a month ($126.50 + $14.16 + $3.02 = $143.68).
What drives the bill is ingestion volume, not retention. In the diagnostic setting, select only the log categories you need before they reach the workspace. (A data collection rule is the filtering mechanism for agent-collected logs, not for diagnostic-setting resource logs.) All figures are list prices at time of writing (November 2026); confirm them in the calculator for Canada Central.
Free tier: Enabling diagnostic settings costs nothing by itself; the destinations bill for what they receive. Practise with the free account's allowances (Log Analytics free ingestion and 5 GB of standard storage) and delete the test data when you are done.
Walkthrough: Create a data collection rule and set table-level retention
The company's verbose debug logs are drowning the security logs. This walkthrough filters collection at the source with a data collection rule. Then it shortens retention on the noisy tables only. The workspace used here is az305-law2: the earlier workspace az305-law was deleted after the S-01 capture session, and a deleted workspace name stays reserved in soft-delete for 14 days, so this session uses a new workspace.
- In the Azure portal, open Azure Monitor, then under Settings select Data Collection Rules and select Create.
- On the Basics tab, name the rule and select the subscription, resource group, and region.
- On the Resources tab, add the virtual machines that will send logs (they need the Azure Monitor Agent installed).
- On the Collect and deliver tab, add a data source for the log type, set the destination to the Log Analytics workspace, and save the rule.
- Open the Log Analytics workspace, select Tables under Settings, and first set the
AuditLogstable's retention to 180 days, so the security audit trail has a long-retention baseline to leave alone. Then select the verbose debug tableVerboseDebug_CLand set its retention to 30 days — the lowest the portal allows — leavingAuditLogsat 180 days. The other tables stay at the workspace default of 30 days.
Table 1.2 — Data collection rule blade
| Section | What to look at |
|---|---|
| Resources tab | Target virtual machines |
| Collect and deliver tab | Data source: Windows event logs; Flows to a Log Analytics workspace |
| Workspace Tables view | Retention column: AuditLogs 180 days; VerboseDebug_CL (custom table) 30 days; AzureDiagnostics workspace default (30 days) |

Azure CLI — the same steps:
The data collection rule itself is defined in a JSON file (the data sources, the destination workspace, and any transformations), so create it from that file, then associate it with the virtual machines. The rule needs the monitor-control-service extension, which the CLI installs automatically the first time you run the command.
The rule file dcr-vm.json holds the rule itself — its data sources, its destination workspace, and the flows between them. Create it with exactly these contents (replace <subscription-id> and <workspace-name> with your own values):
{
"location": "canadacentral",
"properties": {
"dataSources": {
"windowsEventLogs": [
{
"name": "vm-system-application-events",
"streams": ["Microsoft-Event"],
"xPathQueries": [
"System!*[System[(Level=2 or Level=3)]]",
"Application!*[System[(Level=2 or Level=3)]]"
]
}
],
"performanceCounters": [
{
"name": "vm-perf-counters",
"streams": ["Microsoft-Perf"],
"samplingFrequencyInSeconds": 60,
"counterSpecifiers": [
"\\Processor(_Total)\\% Processor Time",
"\\Memory\\Available MBytes"
]
}
]
},
"destinations": {
"logAnalytics": [
{
"name": "prod-workspace",
"workspaceResourceId":
"/subscriptions/<subscription-id>/resourceGroups/rg-prod/providers/Microsoft.
OperationalInsights/workspaces/<workspace-name>"
}
]
},
"dataFlows": [
{ "streams": ["Microsoft-Event"], "destinations": ["prod-workspace"] },
{ "streams": ["Microsoft-Perf"], "destinations": ["prod-workspace"] }
]
}
}
The Windows event source collects Warning, Error, and Critical events from the System and Application logs; the performance-counter source samples CPU and memory every 60 seconds. Both streams flow to the workspace named in destinations. Then create the rule from the file:
az monitor data-collection rule create --name dcr-vm --resource-group rg-prod --location canadacentral --rule-file dcr-vm.json az monitor data-collection rule association create --name dcr-vm-association --rule-id /subscriptions/<subscription-id>/resourceGroups/rg-prod/providers/Microsoft.Insights/ dataCollectionRules/dcr-vm --resource /subscriptions/<subscription-id>/resourceGroups/ rg-prod/providers/Microsoft.Compute/virtualMachines/<vm-name> az monitor log-analytics workspace table update --resource-group rg-prod --workspace-name <workspace-name> --name AuditLogs --retention-time 180 az monitor log-analytics workspace table update --resource-group rg-prod --workspace-name <workspace-name> --name VerboseDebug_CL --retention-time 30
Expected output:
{
"dataCollectionRule": "dcr-vm",
"id": "/subscriptions/<subscription-id>/resourceGroups/rg-prod/providers/Microsoft.
Insights/dataCollectionRules/dcr-vm",
"location": "canadacentral",
"name": "dcr-vm",
"provisioningState": "Succeeded"
}
Why this, not that:
| Option | Cost | Scale | Security | Operations | Pick it when |
|---|---|---|---|---|---|
| Collect everything (Analytics plan) | $2.30 per GB ingested | Full KQL, alerting, 730-day interactive retention | All data queryable for investigation | Simplest; nothing to filter | Low-volume, high-value logs (sign-ins, firewall) |
| Filter at source with a DCR (agent-collected VM logs only — a DCR cannot filter diagnostic-setting categories) | Lower ingestion — noisy events never sent | Same workspace scale, less volume | A filter can drop evidence if wrong | DCRs to version and review | Verbose debug logs drowning security logs |
| Basic table plan | $0.60 per GB ingested | 30-day interactive window; search jobs for older data | Total retention up to 12 years | Plan set per table | High-volume logs rarely queried |
| Auxiliary table plan | $0.06 per GB ingested | Queryable for the total retention period (up to 12 years), not only a 30-day window; search jobs are not needed to read older Auxiliary data | Total retention up to 12 years | Plan set per table | High-volume logs rarely queried, but kept queryable for the whole retention period |
Do not lump Basic and Auxiliary together on retention. Both have only a total retention period (30 days by default, up to 12 years), but they differ in what you can query: Basic data is queryable for 30 days and retrievable after that only through search jobs, while Auxiliary data stays queryable for the whole total retention period. A table that must be queried across its full retention without search jobs is an Auxiliary table, not a Basic one.
Free tier: Data collection rules are free; the workspace ingestion they send is billed. Keep the test to existing resources or the free account's allowances, and delete the rule when you are done.
Symptom–cause–fix: log routing
| Symptom | Likely cause | Fix |
|---|---|---|
| No resource logs appear in the workspace | Diagnostic settings were never enabled on the resource | Enable diagnostic settings; platform metrics alone are not logs |
| Logs stop after 30 days | Workspace retention is at the 30-day default | Raise table-level retention; note it is not retroactive |
| New VMs produce no logs | No data collection rule targets them; or the retired Log Analytics agent is referenced | Deploy Azure Monitor Agent with a DCR, ideally via Policy |
| Logs exist but the SIEM sees nothing | Diagnostic setting points at a storage account, not the event hub | Add an event hub destination; storage is not a stream |
1.3 Recommend a monitoring solution
Monitoring answers a different question from logging: is the system healthy right now, and will someone be told when it is not? A monitoring design has four layers: collect, visualise, alert, and act.
Azure Monitor
Azure Monitor is the platform, not a single tool. Its components:
- • Metrics: numeric time-series data, collected automatically for platform metrics at one-minute frequency unless the metric definition says otherwise. Metrics are retained 93 days.
- • Logs: records in a Log Analytics workspace, queried with KQL.
- • Alerts: rules that evaluate a signal (metric, log query, activity log event, or resource health) and fire an action group. Alert rules have a frequency and a threshold; log alerts evaluate on a schedule, so they are not instantaneous.
- • Action groups: the notification and automation target — email, SMS, voice, webhook, Logic App, Azure Function, ITSM connector. An alert without an action group notifies nobody.
- • Workbooks and dashboards: visualisation. Workbooks are interactive, query-driven reports; dashboards pin charts and tiles.
- • Application Insights: application performance monitoring — request rates, failures, dependencies, exceptions, and distributed tracing. Now workspace-based: its data lives in a Log Analytics workspace.
- • VM insights / Container insights / Network insights: curated monitoring experiences built on the same platform.
Alert rule vs. action group. An alert rule decides when something is wrong (signal, condition, frequency, threshold). An action group decides who is told and what runs (email, webhook, runbook). The exam routinely offers "create an alert rule" as a distractor when the real gap is that no action group exists — or vice versa.
Designing alerts that do not cry wolf
- • Signal choice: metric alerts are near-real-time and cheap; log alerts are flexible but evaluate on a schedule and cost per evaluation. Use metric alerts for "CPU over 90% for 15 minutes" and log alerts for "three failed sign-ins in 5 minutes".
- • Dynamic thresholds: instead of a fixed number, Azure Monitor can learn the normal pattern and alert on deviation — the right recommendation when the workload has a daily or weekly rhythm and a fixed threshold would fire every Monday morning.
- • Alert processing rules: suppress, reroute, or schedule alerts — for example, suppress low-severity alerts during a planned maintenance window, or route alerts from production to the on-call action group and from development to email only.
- • Service Health and Resource Health: Service Health reports Azure-wide outages in your region; Resource Health reports the health of your specific resources. Recommend both when the requirement is "know whether the problem is Azure or us".
Monitoring for hybrid and on-premises
Azure Arc extends Azure Monitor to servers outside Azure. Arc-enabled servers can run the Azure Monitor Agent and send logs and metrics to the same workspace, so one workbook and one alert rule cover Azure VMs and on-premises servers together. Without Arc, on-premises monitoring is a separate island — the design recommendation is Arc, not a second monitoring tool.

The company's on-call engineer gets paged every night at 02:00 when the nightly batch job legitimately drives CPU to 95% for 20 minutes. Which two design changes fix this without losing real alerts?
Answer: Answer: (1) Use a dynamic threshold or a longer evaluation window so the known nightly pattern does not breach the rule; (2) add an alert processing rule to suppress that specific alert during the scheduled batch window. Deleting the alert would lose genuine out-of-hours failures.
Symptom–cause–fix: monitoring
| Symptom | Likely cause | Fix |
|---|---|---|
| Alert fires but nobody is notified | No action group, or the action group has no notification | Attach an action group with the right email/webhook |
| Alert fires constantly at the same time daily | Fixed threshold on a workload with a daily pattern | Dynamic threshold or alert processing rule for the window |
| No data for an on-premises server | Server is not Arc-enabled and has no agent | Onboard with Azure Arc + Azure Monitor Agent + DCR |
| Cannot see data older than 93 days in metrics explorer | Platform metrics retention is 93 days | Route metrics to a Log Analytics workspace for longer retention |
Walkthrough: Create a scheduled log alert rule and its action group
The company needs to know within minutes when failed logins spike. This walkthrough creates the log alert rule and the action group that notifies the on-call team. The monitoring pipeline diagram above shows where the rule and the action group sit in the flow.
- In the Azure portal, open Azure Monitor, select Alerts, then select Create and Alert rule.
- Under Scope, select the Log Analytics workspace
az305-law2. - Under Condition, select Custom log search and enter the query
SigninLogs | where ResultType!= 0 | summarize count(). The portal reads the measure ascount_with aggregation type Total and a 5-minute granularity. Set the threshold to Static, GreaterThan, 3, and the evaluation frequency to 5 minutes. - Under Actions, select Create action group, name it, and add a notification (email to the on-call distribution list) and, if needed, a webhook or Logic App action.
- On the Details tab, name the rule
failed-login-spike, set its severity to 2, then open the Review + create tab — it shows total pricing of $1.50 — and select Create. Test it by triggering the condition and confirming the notification arrives.
Table 1.3 — Alert rule blade
| Section | What to look at |
|---|---|
| Scope | Log Analytics workspace az305-law2 |
| Condition | KQL query: SigninLogs | where ResultType!= 0; | summarize count(); Measure count_, Aggregation type Total; Threshold Static GreaterThan 3; 5-minute evaluation frequency |
| Actions | Action group |
| Action group | Email notification to the on-call list; Webhook action |


Azure CLI — the same steps:
Create the action group first, then the scheduled-query (log search) alert rule that points at it. The scheduled-query commands need the scheduled-query extension (CLI 2.54 or later), which the CLI installs automatically the first time you run one.
az monitor action-group create --name ag-oncall --resource-group rg-prod --short-name oncall --action email oncall-email <oncall-email-address> --action webhook oncall-webhook <webhook-url> az monitor scheduled-query create --name failed-login-spike --resource-group rg-prod --scopes <workspace-id> --condition "count 'FailedLogins' > 3" --condition-query FailedLogins="SigninLogs | where ResultType!= 0 | summarize count()" --action-groups <action-group-id> --evaluation-frequency 5m --window-size 5m --severity 2 --description "Alert when failed logins spike"
Expected output:
{
"actionGroups": ["/subscriptions/<subscription-id>/resourceGroups/rg-prod/providers/
Microsoft.Insights/actionGroups/ag-oncall"],
"enabled": true,
"evaluationFrequency": "PT5M",
"name": "failed-login-spike",
"scopes": ["/subscriptions/<subscription-id>/resourceGroups/rg-prod/providers/
Microsoft.OperationalInsights/workspaces/<workspace-name>"],
"severity": 2,
"windowSize": "PT5M"
}
Why this, not that:
| Option | Cost | Scale | Security | Operations | Pick it when |
|---|---|---|---|---|---|
| Scheduled log (KQL) alert | Billed per evaluation | Evaluates on a schedule (e.g. every 5 minutes) | Catches patterns across many events | KQL to write and tune | "Three failed sign-ins in 5 minutes" |
| Metric alert | Near-real-time; low cost | Evaluates continuously at 1-minute frequency | Single-signal threshold only | Simple threshold; dynamic thresholds available | "CPU over 90% for 15 minutes" |
| Activity Log alert | No log ingestion cost — platform log | Fires on control-plane events | Audit trail of who changed what | No KQL needed | "Alert when a VM is deleted" |
Free tier: Alert rules and action groups cost very little; log alerts bill per evaluation. Practise on the free account and delete the rule when you are done.
1.4 Recommend an authentication solution
Authentication proves who you are. The design questions are: which users, which factors, which protocol, and what happens when the primary method fails.
The authentication menu
| Method | When to recommend it | Notes |
|---|---|---|
| Password + MFA | Default for human users | Password alone is never the recommendation for anything sensitive |
| Passwordless (Windows Hello for Business, FIDO2 security keys, Microsoft Authenticator phone sign-in) | High-security roles, phishing-resistant requirement | FIDO2 and Windows Hello are phishing-resistant; SMS and voice are not |
| Certificate-based authentication | Devices and services, or smart-card environments | Certificates in Entra ID; lifecycle matters (see §1.8) |
| Managed identity | Azure resources calling other Azure resources | No stored credential at all — the strongest option for service-to-service |
| Service principal + secret/certificate | Third-party or multi-cloud apps that cannot use managed identity | Secret must be stored in Key Vault and rotated |
| Pass-through authentication / password hash sync / federation | Hybrid identity (see §1.5) | Choice depends on on-premises availability requirements |
Phishing-resistant MFA is the phrase the exam uses when it wants FIDO2, Windows Hello for Business, or certificate-based authentication — not SMS, not voice call, not the Authenticator push notification on its own. If a scenario says "must resist phishing" or "must resist push fatigue / MFA fatigue attacks", SMS and push are distractors. Also remember: number matching in Authenticator mitigates push fatigue but does not make push phishing-resistant.
Conditional Access — the enforcement point
Conditional Access is the policy engine that turns authentication requirements into decisions at sign-in. It requires Microsoft Entra ID P1 (standard policies) — risk-based policies need P2 and Identity Protection.
A Conditional Access policy has assignments (who, what apps, under what conditions) and access controls (grant or block, require MFA, require compliant device, require approved app).
Design rules that the exam tests repeatedly:
- • Always exclude at least one emergency-access ("break-glass") account from Conditional Access policies. A misconfigured policy can otherwise lock every administrator out of the tenant. The break-glass account must be cloud-only, use a long random password stored offline, and be monitored with alerts on every sign-in.
- • Policies combine: a user must satisfy all policies that apply. Two policies, one requiring MFA and one requiring a compliant device, together require both. There is no "most permissive wins".
- • Report-only mode first: run a new policy in report-only mode, review the sign-in logs to see who would have been blocked, then enforce. Going straight to "On" is how real outages happen and how exam scenarios are written.
- • Named locations: define trusted office IP ranges and treat other locations as higher risk; never use "all locations" as a trusted location.
Walkthrough: Create a Conditional Access policy in report-only mode
The company wants MFA for all administrators. This walkthrough creates the policy the design rules above describe: report-only first, break-glass excluded, then enforced.
- Open the Microsoft Entra admin center, then go to Protection and Conditional Access, and select Policies and New policy.
- Name the policy, then under Assignments select Users and include the administrator group, and under Exclude add the break-glass emergency-access account.
- Under Target resources, select the cloud apps the policy applies to (or All cloud apps).
- Under Conditions, set the sign-in risk or location conditions the policy should evaluate.
- Under Access controls, select Grant, select Require multifactor authentication, and select Select.
- Under Enable policy, select Report-only, then select Create. Review the sign-in logs for a week to see who would have been blocked, then return and set the policy to On.
Azure CLI: Conditional Access policies cannot be managed with az commands — there is no Conditional Access command group in the Azure CLI. Use the Microsoft Entra admin center (portal) as above, or the Microsoft Graph API.
Why this, not that:
| Option | Cost | Scale | Security | Operations | Pick it when |
|---|---|---|---|---|---|
| Conditional Access | Needs Microsoft Entra ID P1 (risk-based needs P2) | Per user, per sign-in | Controls access at sign-in: MFA, device, risk | All applicable policies must pass | "Admins must use MFA on a compliant device to sign in" |
| Azure RBAC | Included with Azure | Per principal, per scope | Controls what an identity may do to resources | Least privilege; assign to groups | "Developers may manage VMs in dev, not in prod" |
| Azure Policy | Free | Per management group or subscription | Controls what may exist (compliance) | Audit first, then Deny | "No storage account may allow public blob access" |
Free tier: Conditional Access is not in the free tier — it needs Microsoft Entra ID P1 (risk-based policies need P2). If you have no P1/P2 licence, read the steps rather than creating the policy; do not start a trial that converts to paid.
Authentication vs. authorization. Authentication is proving identity ("you are Priya"). Authorization is deciding what that identity may do ("Priya may read the production Key Vault"). Conditional Access sits between the two: it makes authorization-style decisions (allow, block, require MFA) at authentication time. When a scenario complains that "the right person got in but could do too much", that is an authorization failure (RBAC, §1.6), not an authentication failure — and the fix is not more MFA.
The company's administrators sign in from home and the office. A new Conditional Access policy requiring a compliant device was enabled directly, and now nobody can administer the tenant from home. What two design errors were made?
Answer: Answer: (1) The policy was enabled without a report-only trial, so its impact was never measured. (2) No break-glass account was excluded, and no allowance was made for legitimate unmanaged admin access — the policy should have been scoped, tested in report-only mode, and paired with an excluded emergency-access account.
Authentication for external users and applications
- • B2B collaboration: external partners authenticate with their own identity provider and are invited as guests. Guest access is governed by Conditional Access and access reviews, not by creating member accounts for outsiders.
- • B2C: customer-facing applications where the users are consumers, not employees — self-service sign-up, social identity providers, custom policies. Recommending B2B for customers (or B2C for employees) is a classic wrong answer.
- • Workload identities: applications and services authenticate as service principals, managed identities, or workload identity federation (federating with an external identity provider such as GitHub Actions, so no stored secret is needed at all).
1.5 Recommend an identity management solution
Identity management is the lifecycle: how identities are created, kept accurate, and removed. The exam's favourite failure mode is an identity that outlives the person — a leaver whose account still works six months later.
Hybrid identity
The company has an on-premises Active Directory and a Microsoft Entra tenant. Three sync/authentication designs exist:
| Design | How sign-in works | When to recommend it |
|---|---|---|
| Password hash synchronization (PHS) | Hashes sync to Entra ID; Entra ID authenticates | Simplest; works even if on-premises is down; supports leaked-credential detection |
| Pass-through authentication (PTA) | Password is validated against the on-premises domain controller at sign-in | Passwords never leave on-premises; needs high availability (agents on multiple servers) |
| Federation (AD FS or another IdP) | Sign-in is redirected to the on-premises federation service | Required for smart cards, third-party MFA at sign-in, or specific compliance needs; most complex |
Microsoft Entra Connect Sync is the full sync engine (single- and multi-forest). Microsoft Entra Cloud Sync is the lighter, cloud-managed agent for the same topologies. It is the right choice for simpler or multi-forest scenarios that do not need the full engine.
The design recommendation in most exam scenarios is PHS with seamless single sign-on. It is the simplest, it survives an on-premises outage, and it enables Identity Protection's leaked-credentials detection. PTA is the answer only when a requirement explicitly forbids password hashes leaving the premises. Federation is the answer only when a requirement (smart cards, a third-party identity provider) cannot be met any other way.
Seamless single sign-on (SSO). With PHS or PTA, seamless SSO lets a domain-joined machine on the corporate network sign in to Entra ID without re-entering credentials, using a Kerberos ticket. It is a user-experience feature, not an authentication method — it does not replace MFA.
Lifecycle and provisioning
- • HR-driven provisioning: identities flow from the HR system (for example Workday or SuccessFactors) into Entra ID automatically. Joiners get accounts on day one, and leavers lose access when HR records the departure. There is no manual ticket and no lag. This is the design answer to "leavers keep access for weeks".
- • Group-based provisioning and dynamic groups: membership rules (for example, "all users in the Engineering department") keep groups accurate without manual maintenance. Dynamic groups require P1.
- • Self-service password reset (SSPR): users reset their own passwords after registering authentication methods. It requires a licence. Cloud-only password reset needs Microsoft 365 Business Standard or higher, or Entra ID P1/P2. (Only a password change by a user who knows their current password is included in Entra ID Free.) SSPR reduces help-desk load. Password writeback to on-premises Active Directory for hybrid users specifically requires Entra ID P1/P2 (or Microsoft 365 Business Premium). It is not a substitute for MFA.
- • Administrative units: delegate administration over a subset of users (for example, one region's users) without granting tenant-wide roles. The answer when a scenario says "the regional admin must manage only their region's users".
When a scenario's root problem is "a user who left three months ago still has access", the exam wants a lifecycle answer — HR-driven provisioning, access reviews, or entitlement management — not a stronger password policy. Read the symptom: stale access is a lifecycle failure.
The company acquires a small company with its own Active Directory forest and wants both forests' users in one Entra ID tenant with minimal infrastructure. Which sync approach, and why not a full federation deployment?
Answer: Answer: Microsoft Entra Cloud Sync (or Entra Connect Sync for multi-forest), because it is agent-based and lightweight. Federation with AD FS would add servers, certificates, and high-availability requirements that the scenario does not justify. It is only needed for smart cards or third-party sign-in requirements.
1.6 Recommend a solution for authorizing access to Azure resources
Authorization to Azure resources is Azure RBAC (role-based access control). It answers "who may do what, to which resource". RBAC is enforced by Azure Resource Manager at the control plane. It does not govern data inside a resource — that is data-plane authorization, handled by the service itself (for example, storage data roles or Key Vault data roles).
How RBAC works
An RBAC assignment has three parts: a security principal (user, group, service principal, or managed identity), a role definition (what actions are allowed), and a scope (where it applies — management group, subscription, resource group, or resource). Assignments inherit downwards: a role at the subscription applies to every resource group and resource beneath it.
| Built-in role | Scope of power | When to use it |
|---|---|---|
| Owner Built-in role | Full control including granting access Scope of power | Almost never for day-to-day work; break-glass and subscription owners only When to use it |
| Contributor | Full control except granting access | Developers who manage resources but must not assign roles |
| Reader | Read-only | Auditors, support staff, cost reviewers |
| User Access Administrator | Manage role assignments, no resource control | The person who grants access, separated from those who use it |
Least privilege is the design principle: assign the narrowest role, at the narrowest scope, to a group rather than an individual. Assign roles to groups, not users — when someone changes team, group membership changes and access follows automatically.
RBAC vs. Azure Policy. RBAC answers "who is allowed to do something". Azure Policy answers "what is allowed to exist". An Owner can still be blocked by a Deny policy from deploying a VM in a forbidden region, because Policy evaluates the resource, not the person. The exam will present a scenario where an Owner cannot deploy something and ask why — the answer is Policy, not a missing role.
Advanced authorization
- • Custom roles: when no built-in role fits (for example, "restart VMs but not delete them"), define a custom role in JSON with exactly the allowed and denied actions. Custom roles are a design answer, not a first resort — check the built-ins first.
- • Deny assignments: system-managed blocks (for example, on managed resources) that override even Owner. You cannot create your own deny assignments directly in most scenarios.
- • Privileged Identity Management (PIM) for Azure resources: eligible role assignments that are activated just-in-time, with MFA, approval, justification, and a time limit. Requires Entra ID P2 or Entra ID Governance. This is the answer to "standing administrative access is prohibited".
- • Azure Lighthouse: delegate management of your subscriptions to another tenant (for example, a managed service provider) with fine-grained, auditable RBAC — without sharing credentials or giving away ownership.
- • Managed identities for resources: a VM or app that needs to read a storage account should use its managed identity with a data-plane role (such as Storage Blob Data Reader), not a shared storage key and not a service principal secret.
A developer at the company needs to deploy and manage VMs in the development resource group but must not be able to grant anyone else access or touch production. Which role, at which scope?
Answer: Answer: Contributor at the development resource group scope. Contributor allows managing resources but not assigning roles, and scoping to the resource group keeps production untouched. Owner would allow role assignment; subscription scope would include production.
1.7 Recommend a solution for authorizing access to on-premises resources
On-premises authorization is about letting cloud identities reach on-premises resources — and on-premises users reach cloud resources — without punching holes in the firewall or duplicating identities.
The patterns
| Pattern | What it does | When to recommend it |
|---|---|---|
| Microsoft Entra Application Proxy | Publishes an on-premises web application through Entra ID; users sign in with Entra ID and Conditional Access applies | Remote access to an internal web app without a VPN |
| Microsoft Entra Private Access (Global Secure Access) | Identity-aware, per-application network access to on-premises and private resources | Replacing VPN with Zero Trust access; requires Entra Suite / Private Access licensing |
| VPN gateway / ExpressRoute + Azure AD Domain Services | Network-level connectivity; domain-join in the cloud | Legacy apps that need Kerberos/NTLM and domain membership |
| Azure AD Domain Services | Managed domain services in Azure (domain join, group policy, LDAP, Kerberos) | Lift-and-shift apps that need a domain but you do not want domain controllers in Azure |
| Azure Bastion | RDP/SSH to VMs over TLS through the portal, no public IP | Secure admin access to Azure VMs (not on-premises servers) |
Application Proxy is the exam's favourite answer for "publish an internal web app to remote users without a VPN". VPN is the distractor. The giveaway is the word web application and the requirement for Conditional Access and MFA at the front door — Application Proxy gives you both, because authentication happens in Entra ID before traffic reaches the internal server.
Authorization inside the on-premises world
- • On-premises AD groups and group policy still govern file shares, printers, and legacy applications. The design task is to keep those groups authoritative on-premises and mirror them into Entra ID through sync, rather than maintaining two parallel group systems.
- • Kerberos constrained delegation lets a service act on a user's behalf to a back-end resource — the mechanism behind Application Proxy's single sign-on to Kerberos-based internal apps.
- • Just-enough-administration (JEA) and tiering: on-premises privileged access follows the same least-privilege and just-in-time principles as the cloud; PIM for groups and privileged access workstations apply equally.
The company's finance team works from home and needs the on-premises intranet expense app, which uses Windows Integrated Authentication. The security team forbids a VPN and wants MFA enforced. Which solution?
Answer: Answer: Microsoft Entra Application Proxy with Kerberos constrained delegation for single sign-on to the internal app, plus a Conditional Access policy requiring MFA. No VPN, no public exposure of the server, and Entra ID enforces MFA before access.
Azure Bastion is not an answer for on-premises access. Bastion gives RDP/SSH to Azure VMs through the portal with no public IP; it cannot reach a server sitting in the on-premises office. If the scenario's server is on-premises, Bastion is a distractor — the answers are Application Proxy (web app), Private Access (per-application network access), or a VPN/ExpressRoute connection.
1.8 Recommend a solution to manage secrets, certificates, and keys
Every secret that lives in code, in a configuration file, or in someone's head is a breach waiting for a repository leak. The design answer is to centralise secrets in Azure Key Vault and remove them from everywhere else.
Azure Key Vault
Key Vault stores three object types: secrets (passwords, connection strings, API keys), keys (encryption keys, including keys for customer-managed encryption), and certificates (TLS certificates, including auto-renewal). Design decisions:
- • Access model: use Azure RBAC for the data plane (roles such as Key Vault Secrets User and Key Vault Secrets Officer) rather than the legacy vault access policies. RBAC gives central, auditable, PIM-eligible control. Access policies are per-vault and harder to govern at scale.
- • Network isolation: disable public network access and use private endpoints so the vault is reachable only from the virtual network. Firewall rules alone are weaker than a private endpoint.
- • Soft delete and purge protection: soft delete retains deleted vaults and objects for a configurable 7 to 90 days (90 days by default), so accidental deletion is recoverable. Purge protection is optional and not enabled by default. When on, nothing can be permanently deleted until the retention period passes. Enable it for production vaults, especially those holding encryption keys, because several Azure services require it.
- • Managed HSM vs. standard vault: a standard vault stores keys in software-protected storage managed by Microsoft. HSM-backed keys require the Premium tier. Managed HSM gives single-tenant, FIPS 140-3 Level 3 validated hardware with customer-controlled keys, for the strictest compliance requirements. Recommend Managed HSM only when the requirement names hardware isolation or customer-controlled HSM. It costs more and is more complex to operate.
- • Rotation: secrets and keys should rotate automatically where possible. Key Vault supports auto-rotation for keys and certificates, and for a few managed secret types (for example, storage account keys). For an ordinary secret such as a database password there is no native automatic rotation. Rotation is a custom workflow, for example an Event Grid-triggered Function that sets a new secret version. A secret that never rotates is a design defect.
Walkthrough: Create a Key Vault with purge protection and store a secret
The company's payment service needs its database password out of configuration files. This walkthrough creates the vault, protects it against deletion, and stores the secret.
- In the Azure portal, select Create a resource, search for Key Vault, and select Create.
- On the Basics tab, select the subscription and resource group, name the vault, select the region, and set Purge protection to Enable. Soft delete is on by default for new vaults.
- On the Access configuration tab, select Azure role-based access control as the permission model.
- On the Networking tab, disable public network access and add a private endpoint so the vault is reachable only from the virtual network.
- Select Review + create, then Create. Once the vault exists, select Secrets, select Generate/Import, name the secret, enter the password, and select Create.
- Assign the payment service's managed identity the Key Vault Secrets User role on the vault. Rotation of this secret is a custom workflow, not a Key Vault toggle: there is no built-in automatic rotation for secrets and no portal "enable rotation" switch for a secret. To rotate
db-passwordon a
schedule, build an Event Grid-triggered rotation workflow (for example, an Azure Function that writes a new secret version) or rotate it from the application that owns the password, and set a new secret version with az keyvault secret set (as in Lab 1, "Try it further").
Table 1.4 — Key Vault blade
| Section | What to look at |
|---|---|
| Vault overview | Soft delete: Enabled; Purge protection: Enabled |
| Secrets list | Secret with its versions |
| Access control | Managed identity holds the; Key Vault Secrets User role |


Azure CLI — the same steps:
az keyvault create --name kv-prod --resource-group rg-prod --location canadacentral --enable-purge-protection true --enable-rbac-authorization true az keyvault secret set --vault-name kv-prod --name db-password --value <password> az role assignment create --role "Key Vault Secrets User" --assignee-object-id <managed-identity-object-id> --assignee-principal-type ServicePrincipal --scope /subscriptions/<subscription-id>/resourceGroups/rg-prod/providers/Microsoft.KeyVault/ vaults/kv-prod az network private-endpoint create --name pe-kv-prod --resource-group rg-prod --location canadacentral --vnet-name vnet-prod --subnet snet-private --private-connection-resource-id /subscriptions/<subscription-id>/resourceGroups/ rg-prod/providers/Microsoft.KeyVault/vaults/kv-prod --group-id vault --connection-name pe-kv az keyvault update --name kv-prod --resource-group rg-prod --public-network-access Disabled
Create the private endpoint before disabling public network access, or the vault becomes unreachable: disabling public access first leaves no path into the vault. The private DNS zone setup for the endpoint follows the same az network private-endpoint dns-zone-group create pattern shown in walkthrough S-12, with privatelink.vaultcore.azure.net as the zone.
Key rotation is a CLI command — az keyvault key rotation-policy update --vault-name <vault> --name <key> --value <policy.json> (and a portal setting). But that rotates keys, not secrets. Secret rotation has no native automatic rotation in Key Vault and needs the custom workflow described in step 6.
Expected output:
{
"location": "canadacentral",
"name": "kv-prod",
"properties": {
"enablePurgeProtection": true,
"enableRbacAuthorization": true,
"enableSoftDelete": true,
"publicNetworkAccess": "Disabled",
"vaultUri": "https://kv-prod.vault.azure.net/"
},
"resourceGroup": "rg-prod"
}
Why this, not that:
| Option | Cost | Scale | Security | Operations | Pick it when |
|---|---|---|---|---|---|
| Key Vault + managed identity (recommended) | $0.03 per 10,000 operations (Standard) | One vault per region; RBAC at scale | Secrets never in code; purge protection, and rotation (native for keys and certificates; secrets need a custom rotation workflow) | Vault, RBAC, and rotation to operate | Any secret, key, or certificate |
| App Configuration (+ Key Vault reference) | Free tier for evaluation; Standard bills per store per day | Central settings for many apps and environments | Holds non-secret settings only; secrets stay in Key Vault | Feature flags and settings in one place | Settings and flags that change without a redeploy (see §4.10) |
| Managed identity alone (no vault) | Free — no charge for the identity | Per Azure resource | No secret to leak, but no place to store one | Nothing to rotate | Azure-to-Azure calls that need no stored secret |
Worked cost example: Price it in the Azure pricing calculator under Key Vault, region Canada Central. The Standard vault bills $0.03 per 10,000 operations, with no storage fee, at time of writing (November 2026).
The payment service reads db-password once at startup and caches it. Three services reading once an hour is 3 × 24 × 30 = 2,160 operations a month, about $0.01 a month. Read the secret on every request instead and 1 million reads a month is 100 × $0.03 = $3.00 a month. That is still small, but caching is the habit that keeps it so.
The private endpoint in step 4 is the real line item: $0.01 an hour is about $7.30 a month, plus $0.01 per GB processed. Total for this walkthrough's resources: roughly $7.31 a month with cached reads. What drives the bill is uncached reads and endpoint hours, not the number of secrets. Premium HSM-backed keys, if ever needed, add $1 per key per month.
Free tier: Key Vault has no free tier, but a standard vault costs very little for practice (operations are billed per 10,000 operations). Step 4 also adds a private endpoint, which bills about $0.01 per hour with no free tier. Deleting the vault does not delete the endpoint, so delete that too when you are done.
Remember purge protection means a deleted vault stays recoverable for the retention period, so plan the cleanup.
Customer-managed key (CMK) vs. platform-managed key. With a platform-managed key, Microsoft generates and rotates the encryption key. With a customer-managed key, the key lives in your Key Vault (or Managed HSM) and you control rotation and revocation — revoking the key makes the data unreadable. CMK is the answer when a requirement says "we must be able to revoke access to our data" or "keys must be under our control".
Getting secrets to applications
| Approach | How it works | Verdict |
|---|---|---|
| Managed identity + Key Vault reference | App authenticates as its managed identity; App Service / Functions resolve @Microsoft.KeyVault(...) references at runtime | Recommended: no credential stored anywhere |
| Managed identity + SDK | Code fetches the secret from Key Vault at start-up using its managed identity | Recommended for code that needs the value directly |
| Service principal + secret in code/config | Secret stored in the application | Avoid: the secret itself becomes the vulnerability |
| Environment variables with plaintext secrets | Secret in the deployment pipeline or portal settings | Avoid for production; acceptable only for non-sensitive config |
If a scenario says an application "stores its database password in its configuration file", the exam wants you to recommend Key Vault with a managed identity — and the wrong answers will include "encrypt the configuration file" or "move the password to a different file". Moving a secret is not managing a secret.
Symptom–cause–fix: secrets
| Symptom | Likely cause | Fix |
|---|---|---|
| Application cannot read a secret after deployment | It uses a service principal secret that expired, or has no Key Vault role | Switch to a managed identity with Key Vault Secrets User |
| Deleted secret cannot be recovered | Vault was created without soft delete, or the retention period passed | Soft delete is now on by default for new vaults; recover within 7–90 days |
| Vault deleted by a malicious admin | No purge protection | Enable purge protection and monitor vault deletions with alerts |
| Certificate expired and the site went down | Manual renewal with no alert | Enable auto-rotation and alert on certificate expiry |
The company's payment service uses a database password that is copied into every deployment's configuration file and has not changed in two years. Name the three design changes.
Answer: Answer: (1) Move the password into Key Vault as a secret. (2) Give the service a managed identity with the Key Vault Secrets User role so it retrieves the secret at runtime — no password in any file. (3) Rotate the password on a schedule through a custom rotation workflow (Key Vault has no built-in automatic rotation for secrets) — for example, an Event Grid-triggered Function that sets a new secret version.
1.9 Recommend a structure for management groups, subscriptions, and resource groups, and a strategy for resource tagging
Governance starts with structure. The hierarchy is: tenant → management group → subscription → resource group → resource. Each level exists for a different reason, and the exam tests whether you put each decision at the right level.
The hierarchy, level by level
| Level | What it is for | Key facts |
|---|---|---|
| Management group | Governance at scale: apply Policy and RBAC once, inherit everywhere below | One tenant supports up to 10,000 management groups; a tree supports up to 6 levels of depth (excluding the root and subscription levels); each group or subscription has exactly one parent |
| Subscription | Billing boundary and scale boundary | Billing is per subscription; RBAC and Policy assigned here apply to everything inside; a subscription belongs to one management group |
| Resource group | Lifecycle boundary: resources that live and die together | A resource group can hold resources from different regions; a resource belongs to exactly one resource group; up to 980 resource groups per subscription |
| Resource | The service instance itself | Tags, locks, and diagnostic settings apply here |

Design principles
- • Keep the tree shallow. Azure allows six levels, but three or four is the practical design: root → platform/workloads → environment (production/non-production) → subscription. Deeper trees become hard to audit and produce surprising policy inheritance.
- • Separate by environment and by blast radius, not by team. Production and non-production must be in different subscriptions at minimum, so a mistake in development cannot touch production and so a Deny policy on production never blocks a developer's experiment.
- • Follow the Cloud Adoption Framework landing-zone pattern: a platform (management) subscription for shared services — networking, logging, identity — and workload subscriptions per application or business unit. Shared services live once, in the platform subscription, instead of being duplicated in every workload subscription.
- • Resource groups follow the application lifecycle: one resource group per application per environment. When the application is retired, deleting the resource group deletes everything that belonged to it. Never put two applications with different lifecycles in one resource group, and never put a shared resource (such as a virtual network) in an application's resource group.
Inheritance is one-way and cumulative. Policy and RBAC assigned at a management group flow down to every subscription, resource group, and resource below it, and assignments at multiple levels all apply — a Deny at the top and a Deny at the bottom do not cancel each other out. There is no "override" by assigning something more permissive lower down. If a scenario asks how to exempt one subscription from a management-group policy, the answer is a policy exemption (with an expiry and a reason), not a conflicting assignment.
A subscription has exactly one parent, and it is the billing boundary. Each subscription sits under exactly one management group, and billing is per subscription — so splitting production and development into separate subscriptions is what keeps their bills, their RBAC, and their blast radius apart. A resource group is different again: it is a lifecycle boundary, not a billing or security boundary, and one resource group can hold resources from different regions.
Tagging strategy
Tags are name-value metadata on resources, resource groups, and subscriptions, used for cost allocation, ownership, automation, and governance. Design facts, verified against Microsoft documentation:
- Each resource, resource group, or subscription can have a maximum of 50 tag name-value pairs. A tag name is limited to 512 characters and a tag value to 256 characters. (Storage accounts limit tag names to 128 characters.)
- Tags do not inherit automatically: a tag on a resource group does not flow to the resources inside it. Inheritance is achieved with Azure Policy (Modify effect to append tags) or through infrastructure-as-code templates.
- A small, mandatory tag set beats a large optional one. The standard set:
Environment(Production/Development/Test),CostCenter,Owner,Application, andDataClassification. Every other tag is optional. - Enforce tags with Policy: an Audit policy first to measure the gap, then a Deny policy to block untagged deployments, or a Modify policy to add the tag automatically. A Deny policy on tags that blocks deployments without a CostCenter is the exam's standard example.
The exam's favourite tagging trap: "we tagged the resource group, so all resources are tagged for cost reporting." They are not. Cost Management can group by resource-group tag as a workaround, but the resources themselves carry no tag until Policy or a template adds it. If the requirement is per-resource cost allocation, recommend a Modify policy that appends tags.
The company has one subscription containing production and development resources, and a developer accidentally deleted a production database. Which two structural changes prevent a repeat?
Answer: Answer: (1) Split production and development into separate subscriptions under separate management groups, so development activity cannot reach production. (2) Put a CanNotDelete resource lock on the production database (and use RBAC so developers are not Owners of production).
1.10 Recommend a solution for managing compliance
Compliance is proving, continuously and with evidence, that the estate meets a standard — internal or regulatory. It is not a one-off audit; it is a control plane.
Azure Policy
Azure Policy evaluates resources against rules and reports compliance. Its components:
- • Policy definition: a rule written in JSON, with conditions and an effect. Effects:
Audit(flag non-compliance),Deny(block the deployment),Modify(change the resource, for example add a tag),Append,DeployIfNotExists(deploy a companion resource, for example a monitoring agent, and remediate),AuditIfNotExists,Disabled, andManual.ModifyandDeployIfNotExistsneed a managed identity on the assignment to perform remediation. - • Initiative (policy set): a bundle of definitions assigned as one unit — for example, the built-in regulatory initiatives for CIS, NIST SP 800-53, ISO 27001, or PCI DSS. Use initiatives for a standard, not dozens of individual assignments.
- • Assignment: a definition or initiative applied at a scope (management group, subscription, resource group, or resource). Assignments inherit downwards.
- • Exemption: a scoped, time-limited, reasoned exception that still shows in compliance reporting as exempt. Prefer exemptions over exclusions (
notScopes), which hide the resource from reporting entirely. - • Compliance dashboard: per-assignment compliance state, non-compliant resources, and remediation tasks. Limits to know: 500 policy definitions and 200 assignments per scope; 1,000 exemptions per scope.
Adoption pattern: start in Audit mode to measure the blast radius, then move to Deny. Going straight to Deny is the governance equivalent of enabling a Conditional Access policy without report-only mode — it will break legitimate deployments.
Walkthrough: Build the management-group hierarchy and assign a policy in Audit mode
The company needs one governance structure for the whole estate. This walkthrough builds the hierarchy the Governance hierarchy diagram in §1.9 shows, then assigns a policy in Audit mode first, exactly as the adoption pattern above requires.
- In the Azure portal, open Management groups, select Add management group, and create the platform and workload groups under the tenant root, then the production and non-production groups beneath them.
- Move each subscription under its management group (production subscriptions under the production group, and so on).
- Open Azure Policy, select Assignments, and select Assign policy.
- Under Scope, select the production management group. Under Policy definition, select the built-in initiative for the standard being enforced (for example, a regulatory initiative), or a single definition such as the one blocking public blob access.
- On the Parameters tab, set any required values. On the Review + create tab, confirm the enforcement mode is Audit (not Deny), then select Create.
- Open the Compliance dashboard, review how many resources are non-compliant, and only then change the assignment to Deny (or add a scoped, time-limited exemption for a named exception).
- Create a second assignment at subscription scope for the Key Vault soft-delete control. This is the assignment the S-05b capture below shows (
az305-kv-softdelete-audit, scoped to Azure subscription 1, in Audit mode) — a subscription-scoped audit assignment alongside the
management-group assignment above, so you can compare what each scope reports.
Table 1.5 — Policy assignment blade
| Section | What to look at |
|---|---|
| Scope | Production management group |
| Initiative | Initiative selected |
| Enforcement mode | Audit |
| Compliance dashboard | Non-compliant resources counted; before the assignment is changed to Deny |


Azure CLI — the same steps:
az account management-group create --name mg-platform --display-name "Platform" az account management-group create --name mg-workloads --display-name "Workloads" az account management-group create --name mg-prod --display-name "Production" --parent mg-workloads az account management-group create --name mg-nonprod --display-name "Non-Production" --parent mg-workloads az account management-group subscription add --name mg-prod --subscription <production-subscription-id> az account management-group subscription add --name mg-nonprod --subscription <non-production-subscription-id> az policy assignment create --name block-public-blob-audit --scope <management-group-id> --policy-set-definition <initiative-id> --enforcement-mode DoNotEnforce az policy assignment create --name az305-kv-softdelete-audit --scope /subscriptions/<subscription-id> --policy <key-vault-soft-delete-audit-policy- definition-id> --enforcement-mode DoNotEnforce
The second command creates the subscription-scoped assignment the S-05b capture shows. Use the built-in policy definition that audits Key Vault soft-delete in place of the <key-vault-soft-delete-audit-policy-definition-id> placeholder. Its output has the same shape as the management-group assignment's, with "name": "az305-kv-softdelete-audit" and the subscription as its scope.
Expected output (illustrative output — management-group create):
{
"displayName": "Production",
"id": "/providers/Microsoft.Management/managementGroups/mg-prod",
"name": "mg-prod",
"properties": {
"details": { "parent": { "id":
"/providers/Microsoft.Management/managementGroups/mg-workloads" } }
},
"type": "Microsoft.Management/managementGroups"
}
Why this, not that:
| Option | Cost | Scale | Security | Operations | Pick it when |
|---|---|---|---|---|---|
| Management group + Audit | Policy and management groups are free | One assignment covers every subscription below | Non-compliance flagged, nothing blocked | Measure the blast radius first | Rolling out a new control (this walkthrough) |
| Management group + Deny | Free | Same inheritance, enforced everywhere | Blocks non-compliant deployments | Exemptions needed for named exceptions | The control is proven and must be enforced |
| Flat subscriptions, per-subscription policy | Free | Each subscription assigned separately | Gaps appear in every new subscription | One assignment per subscription to maintain | One subscription only |
| Disabled | Free | — | No control at all | — | Turning a control off temporarily; never a design |
Free tier: Management groups and Azure Policy are free — no resource is created and no charge applies.
Azure Policy vs. resource locks. Policy controls what may exist (no VM in a forbidden region, no storage account without encryption). A resource lock controls what may happen to an existing resource: CanNotDelete prevents deletion, ReadOnly prevents any change. Locks are the answer to "stop anyone deleting production"; Policy is the answer to "stop anyone creating non-compliant resources".
Defender for Cloud and regulatory compliance
- • Microsoft Defender for Cloud continuously assesses the security posture of Azure (and, via Arc, hybrid) resources against benchmarks such as the Microsoft Cloud Security Benchmark. It reports a secure score with recommendations. Its regulatory compliance dashboard maps the estate against standards such as CIS, NIST, ISO 27001, and PCI DSS.
- • Microsoft Purview governs data: data discovery and classification, sensitivity labels, data loss prevention, and audit retention for Microsoft 365 data. Recommend Purview when the compliance requirement is about data (where personal data lives, who accessed it); recommend Defender for Cloud when it is about resource configuration.
- • Azure Blueprints entered phased retirement on 31 July 2026 and is scheduled for full retirement on 31 January 2027. Do not recommend it for a new design. Its replacement is a combination of management-group policy assignments, deployment stacks, and infrastructure-as-code templates (Bicep or Terraform) versioned in source control.
Compliance evidence and audit
- The activity log and Entra ID audit logs are the evidence trail for who changed what. Route them to a Log Analytics workspace or a storage account before they expire (90 days in the portal for the activity log; 30 days for Entra logs on P1/P2).
- • Change tracking and inventory (Azure Monitor / Azure Arc, Azure Monitor Agent based) records configuration drift on VMs.
- • Resource Graph queries the current state of the whole estate at scale — the right tool for "list every storage account in the tenant without public access", faster and cheaper than querying each subscription.
The company must prove to auditors that no storage account in production allows public blob access, and must block any new one that tries. Which two Policy steps, in which order?
Answer: Answer: (1) Assign the built-in policy in Audit mode at the production management group to measure how many accounts are non-compliant. (2) Change the effect to Deny (or use the DeployIfNotExists remediation for existing accounts) once the blast radius is understood. Audit first, Deny second.
Prefer an exemption over an exclusion. A policy exemption is scoped, time-limited, reasoned, and still shows in compliance reporting as exempt — the auditor can see it. An exclusion (notScopes) hides the resource from reporting entirely, so a compliance dashboard can read 100% while the excluded resources are non-compliant. If a scenario shows 100% compliance that the auditors dispute, check for exclusions first.
Symptom–cause–fix: compliance
| Symptom | Likely cause | Fix |
|---|---|---|
| Policy blocks a legitimate deployment | Deny enabled before the blast radius was measured | Move to Audit, review, add a scoped exemption, then re-enable Deny |
| Compliance dashboard shows 100% but auditors find gaps | Exclusions (notScopes) hide resources from reporting | Replace exclusions with time-limited exemptions that remain visible |
| New resources are non-compliant on day one | Policy assigned at resource-group scope instead of management group | Assign at the management group so future subscriptions inherit it |
| Recommendation in Defender for Cloud never clears | Remediation needs a managed identity the assignment lacks | Grant the assignment's managed identity the required role |
1.11 Recommend a solution for identity governance
Identity governance is the discipline of making sure the right people (and workloads) have the right access, for the right time, with proof. It needs Microsoft Entra ID P2 or Microsoft Entra ID Governance licensing.
The four pillars
| Pillar | What it does | Key feature |
|---|---|---|
| Privileged Identity Management (PIM) | Just-in-time privileged access | Eligible assignments, activation with MFA/approval/justification, time-limited |
| Access reviews | Periodic recertification of access | Reviewers confirm or remove group memberships and role assignments; results can auto-remove |
| Entitlement management | Delegated, self-service access to resources | Access packages bundle roles and resources; approval workflows; time-limited grants |
| Lifecycle workflows | Automate joiner/mover/leaver tasks | Triggered by HR events or schedules; tasks such as disabling accounts and removing licences |
Privileged Identity Management in depth
PIM replaces standing admin access with eligible assignments. An administrator holds no active privilege until they activate it, for a limited time, with controls the design can require: MFA, approval by a named approver, a written justification, and a maximum activation duration. Every activation is logged. PIM covers both Entra ID roles (Global Administrator, User Administrator) and Azure resource roles (Owner, Contributor), and PIM for Groups covers privileged group membership.
The two modes side by side:
| Aspect | PIM for Azure resources | PIM for Groups |
|---|---|---|
| What it makes eligible | A role, such as Owner or Global Administrator | Membership of a privileged group |
| What activation gives | That role, for a limited time | Group membership, for a limited time — and through the group, every role the group holds |
| Use it when | The privilege is one role on one scope | Several roles travel together through one group |
Design rules:
- Require P2 (or Entra ID Governance) licences for every user who is eligible, who approves, or who reviews — licensing is per person, not per tenant.
- Set a short maximum activation duration — configurable from 1 to 24 hours, with 8 hours the default — and require approval for the most powerful roles.
- Alert on every PIM activation outside business hours, and review the PIM audit history regularly.
- Never make the break-glass account PIM-eligible — it must always work, even if PIM itself is unavailable.
Access reviews and entitlement management
- • Access reviews answer "does this person still need this access?" on a schedule (for example, quarterly for privileged roles, twice a year for guest access). Reviewers can be the manager, the group owner, or the users themselves (self-review). If a reviewer does not respond, the design chooses a fallback. Either access stays (safer for operations) or access is removed (safer for security). The exam expects you to notice which fallback a scenario requires.
- • Entitlement management packages access: an access package bundles the group memberships, roles, and applications a partner or contractor needs, with an approval workflow and an expiry date. When the package expires, access is removed automatically. This is the answer to "external users keep access after the project ends".
- • Terms of use can be attached to access packages so a guest must accept conditions before access is granted.
Identity Protection and risk
Identity Protection (P2) detects risky sign-ins and risky users — leaked credentials, impossible travel, unfamiliar locations, anonymous IPs, malware-linked IPs. It feeds risk-based Conditional Access policies that can block or require MFA and password change. Risky sign-ins are retained for 90 days on P2 (30 days on P1).
The design point: risk detection without a policy that acts on it is only a report. Pair every detection with a Conditional Access policy.
The exam distinguishes three similar-sounding tools by their question. "Who should have access?" is an access review. "How does a partner get access?" is entitlement management. "How does an admin temporarily get privilege?" is PIM. If the scenario's pain is stale guest access after a project ends, the answer is entitlement management with expiry. It is not an access review, which only asks the question, and not PIM, which is for administrators.
PIM activation is always logged — and the break-glass account must never be PIM-eligible. Every PIM activation records who activated which role, with what justification and approval, and for how long. That audit trail is part of the control. The emergency-access account is the one exception. It must always work, even if PIM itself is unavailable, so it holds a permanent (standing) assignment and is excluded from every Conditional Access policy.
The company's auditors found 40 guest accounts from a project that ended a year ago, all still active. Which two governance controls would have prevented this, and which one finds the ones that already exist?
Answer: Answer: Entitlement management with time-limited access packages would have expired the access automatically when the project ended. Access reviews of guest access would have caught the accounts that already exist. One prevents, one detects — a complete design uses both.
1.12 Putting Domain 1 together: the reference design for the company
A complete Domain 1 design for the company looks like this:
- Structure: tenant root → platform and workload management groups → production and non-production management groups → subscriptions per environment. Resource groups per application per environment. Mandatory tags (
Environment,CostCenter,Owner) enforced by a Modify policy. - Logging and monitoring: Log Analytics workspaces per region. Diagnostic settings on every production resource sending to the workspace and a storage account for archive. Azure Monitor metric alerts with action groups. Sentinel for the security team.
- Identity: PHS with seamless SSO. Conditional Access requiring MFA for all users, phishing-resistant MFA for administrators, report-only first, break-glass excluded. B2B for partners. B2C for customers.
- Authorization: RBAC to groups at the narrowest scope. PIM (P2) for all privileged roles. Application Proxy for the internal finance app. Key Vault with RBAC, private endpoints, soft delete, and purge protection for every secret.
- Compliance and governance: built-in regulatory initiatives assigned at the management group in Audit then Deny. Defender for Cloud for posture. Quarterly access reviews. Entitlement management for guests. Lifecycle workflows for joiners and leavers.

Chapter 1 covers all 11 Domain 1 objectives: logging (§1.1), log routing (§1.2), monitoring (§1.3), authentication (§1.4), identity management (§1.5), authorizing access to Azure resources (§1.6), authorizing access to on-premises resources (§1.7), secrets, certificates, and keys (§1.8), management-group/subscription/resource-group structure and tagging (§1.9), compliance (§1.10), and identity governance (§1.11).
Exam facts: AZ-305, skills measured 17 April 2026, pass 700/1000. Microsoft publishes no AZ-305 question count, duration, fee, or case-study count; the typical Microsoft exam format is 40–60 questions in 100 minutes, fee $165, with 2–3 case studies — typical figures, not AZ-305-published facts. The AZ-104 (Azure Administrator Associate) certification must be earned to earn the Expert designation, though AZ-305 can be sat first. Unofficial study material — not affiliated with or endorsed by Microsoft.
Hands-on lab 1 — Guard the keys and watch the vault
Scenario
The company is a mid-sized online training business. Its payment service stores a database password in a configuration file on a virtual machine. Nobody can prove who last read it. The auditors have asked two questions the company cannot yet answer: where is the password stored, and who accessed it?
You are the solutions architect. In this lab you will move the password into Azure Key Vault with purge protection. You will route the vault's audit logs into a Log Analytics workspace. Then you will create a log alert that emails the on-call team when vault access fails.
Everything you build here is the hands-on version of Chapter 1. Secrets belong in a vault. Resource logs are collected only when you enable diagnostic settings. An alert is only useful if it has an action group behind it.
Purge protection is a Key Vault setting that blocks anyone — including an administrator — from permanently deleting a vault or a secret during its retention period. Soft delete lets you recover a deleted vault; purge protection stops the deletion from becoming permanent. Turn it on before the vault holds anything real.
Objectives covered
This lab maps to the Chapter 1 exam objectives in the official AZ-305 study guide (skills measured 17 April 2026):
| Objective | What you practise in this lab |
|---|---|
| Recommend a logging solution | Creating a Log Analytics workspace as the single place vault logs land |
| Recommend a solution for routing logs | Routing Key Vault audit logs to the workspace with a diagnostic setting |
| Recommend a monitoring solution | Building a scheduled log alert on the vault logs |
| Recommend a solution to manage secrets, certificates, and keys | Creating a Key Vault with purge protection and storing a secret in it |
| Recommend a solution for authorizing access to Azure resources | Giving yourself access to the secret through Azure RBAC, not a shared password |
Prerequisites
- A free Azure account (or Azure free trial credits). Nothing in this lab needs a paid tier.
- The Azure CLI installed, or Azure Cloud Shell in the portal (Cloud Shell already has the Azure CLI installed). Sign in first with
az login. - A resource group for this lab: rg-lab1. All resources go in it, so one delete at the end removes everything.
- An email address you control, for the alert action group (use your own address; the alert only fires if a vault access fails).
Names must be unique. Key Vault names are globally unique across Azure, 3–24 characters, letters, numbers and hyphens only. Replace <unique> in the commands below with a short string of your own, for example your initials plus a number (for example kv-lab1-hs7).
Steps
- Create the resource group. In the portal, search for Resource groups, select Create, name it
rg-lab1, pick a region near you (for example Canada Central), and select Review + create, then Create. Or with the CLI:
az group create --name rg-lab1 --location canadacentral
- Create the Key Vault with purge protection. In the portal, search for Key vaults, select Create, choose
rg-lab1, name the vaultkv-lab1-<unique>, and on the Access configuration tab choose Azure role-based access control (RBAC) as the permission model. On the same blade, make sure soft delete is enabled and turn on purge protection. Select Review + create, then Create. Or with the CLI:
az keyvault create --name kv-lab1-<unique> --resource-group rg-lab1 --location canadacentral --enable-rbac-authorization true --enable-purge-protection true
Purge protection can be enabled at creation or later. For example, az keyvault update --name kv-lab1-<unique> --resource-group rg-lab1 --enable-purge-protection true adds it to an existing vault. What can never be undone is the other direction. Once purge protection is enabled, it can never be disabled. That irreversibility is what the exam tests. Soft delete is the recovery mechanism. Purge protection is the guard against permanent deletion.
- Give yourself permission to manage secrets. With RBAC as the permission model, nobody — not even the vault creator — can read secrets until a role is assigned. In the portal, open the vault, select Access control (IAM), select Add role assignment, assign Key Vault Secrets Officer to your own user account, and save. Or with the CLI (replace
<your-user-id>with your Microsoft Entra object ID, shown byaz ad signed-in-user show --query id -o tsv):
az role assignment create --role "Key Vault Secrets Officer" --assignee-object-id <your-user-id> --scope $(az keyvault show --name kv-lab1-<unique> --resource-group rg-lab1 --query id -o tsv)
Role assignments can take a few minutes to propagate — if step 4 fails with an authorization error, wait a few minutes and try again.
- Store the payment service password as a secret. In the portal, open the vault, select Secrets, select Generate/Import, name the secret
DbPassword, paste a strong password as the value, and select Create. Or with the CLI:
az keyvault secret set --vault-name kv-lab1-<unique> --name DbPassword --value "ChangeMe-Str0ng-Password!"
Use a practice password only — never a real production password in a lab.
- Check the secret is there — and mind that the value is shown. Run:
az keyvault secret show --vault-name kv-lab1-<unique> --name DbPassword
Warning: this prints the secret value in plain text in the output — do not run it on a shared screen or paste the output anywhere. If you only want to confirm the secret exists, show its metadata instead:
az keyvault secret show --vault-name kv-lab1-<unique> --name DbPassword --query id -o table
- Create the Log Analytics workspace. In the portal, search for Log Analytics workspaces, select Create, choose
rg-lab1, name itlaw-lab1, pick the same region, and leave the default Pay-As-You-Go pricing tier selected. Select Review + create, then Create. Or with the CLI:
az monitor log-analytics workspace create --resource-group rg-lab1 --workspace-name law-lab1 --location canadacentral
The CLI creates the workspace on the default Pay-As-You-Go tier. That is the tier to keep. There is no selectable "Free tier" for a new workspace. The legacy Free tier (500 MB of ingestion per day) was closed to new workspaces on 1 July 2022.
In Pay-As-You-Go, the first 5 GB of Analytics Logs ingestion per month per billing account is free. So one vault's audit logs are effectively $0 in this lab.
- Route the vault's audit logs to the workspace. This is the step most candidates forget: a Key Vault produces no queryable logs until you enable a diagnostic setting. In the portal, open the Key Vault, select Diagnostic settings under Monitoring, select Add diagnostic setting, name it
kv-audit-to-law, tick AuditEvent under Logs, tick Send to Log Analytics workspace, chooselaw-lab1, and select Save. Or with the CLI (run the two lookup commands first, then the create):
VAULT_ID=$(az keyvault show --name kv-lab1-<unique> --resource-group rg-lab1 --query id
-o tsv)
WORKSPACE_ID=$(az monitor log-analytics workspace show --resource-group rg-lab1
--workspace-name law-lab1 --query id -o tsv)
az monitor diagnostic-settings create --name kv-audit-to-law --resource $VAULT_ID
--workspace $WORKSPACE_ID --logs '[{"category": "AuditEvent", "enabled": true}]'
- Prove the logs are flowing. In the portal, open
law-lab1, select Logs, and run this KQL query. It may take a few minutes after step 7 before the first rows appear — run step 5 again to generate fresh audit events if the table is empty:
AzureDiagnostics | where ResourceProvider == "MICROSOFT.KEYVAULT" | project TimeGenerated, OperationName, ResultType, CallerIPAddress | take 10
- Create the action group that will receive the alert. In the portal, search for Action groups, select Create, choose
rg-lab1, name itag-oncall, give it the short nameOnCall(12 characters maximum), and on the Notifications tab add an Email/SMS message/Push/Voice action namedoncall-emailwith your email address. Select Review + create, then Create. Or with the CLI:
az monitor action-group create --resource-group rg-lab1 --name ag-oncall --short-name OnCall --action email oncall-email <your-email-address>
- Create the scheduled log alert. In the portal, open
law-lab1, select Alerts, select Create, then Alert rule. Set the scope to the workspace, and for the condition choose Custom log search with this query, a threshold of greater than 0, and an evaluation frequency of 5 minutes. On the Actions tab, attachag-oncall. Name the rulekv-failed-access-alertand select Create. Or with the CLI (thescheduled-queryextension installs itself the first time you run it):
AG_ID=$(az monitor action-group show --resource-group rg-lab1 --name ag-oncall --query id -o tsv) WS_ID=$(az monitor log-analytics workspace show --resource-group rg-lab1 --workspace-name law-lab1 --query id -o tsv) az monitor scheduled-query create --name kv-failed-access-alert --resource-group rg-lab1 --scopes $WS_ID --condition "count 'FailedVaultAccess' > 0" --condition-query FailedVaultAccess="AzureDiagnostics | where ResourceProvider == \"MICROSOFT.KEYVAULT\" | where ResultType!= \"Success\"" --action-groups $AG_ID --description "Alert when any Key Vault access fails"
Verify the rule exists and is enabled:
az monitor scheduled-query show --name kv-failed-access-alert --resource-group rg-lab1
--query "{name:name, enabled:enabled}" -o table
Expected result
You have a Key Vault holding one secret (DbPassword), protected by purge protection and RBAC. Its audit events flow into a Log Analytics workspace you can query with KQL. A scheduled log alert watches those logs and emails your action group whenever a vault access fails.
The alert will not fire in a quiet lab. That is correct behaviour. The enabled rule plus the flowing logs are the proof, not a fired alert.
Screenshot — capture this: the Key Vault Overview blade showing the vault name, soft delete and purge protection enabled, and the Secrets list showing DbPassword; and the Log Analytics Logs blade showing the KQL query from step 8 returning AzureDiagnostics rows for the vault.
Lab evidence: capture your own screenshot of the finished result — the vault overview with purge protection shown as enabled, and the Logs blade with vault audit rows — and keep it as proof you completed the lab. A lab is only complete when you can show the finished state. The commands you ran are not enough on their own.
Your alert never fires, even after you mistype the secret name three times. What is the most likely cause?
Answer: Answer: the diagnostic setting is missing or points at a different workspace. The alert queries the workspace, and if no Key Vault logs ever arrive there, the query always returns zero rows. Check Diagnostic settings on the vault first, then check the query returns rows in Logs before trusting the alert.
Cost alert
| Resource created | Cost |
|---|---|
Resource group rg-lab1 | Free — a resource group is a container, not a billable resource. |
Key Vault kv-lab1-<unique> (Standard tier) | No monthly fee. Standard operations are billed per 10,000 transactions — a lab run is a few cents at most. |
Log Analytics workspace law-lab1 (Pay-As-You-Go) | Effectively free in this lab — the first 5 GB of Analytics Logs ingestion per month per billing account is free, and one vault's audit logs are far below that. |
Diagnostic setting kv-audit-to-law | Free — routing logs costs nothing; only the ingestion at the destination is billed, and it is inside the free 5 GB/month allowance. |
Action group ag-oncall | Free — action groups are not billed; only SMS/voice notifications carry a small charge, and this lab uses email only. |
Scheduled log alert kv-failed-access-alert | Log alerts are billed per rule per month by evaluation frequency; one 5-minute rule costs $1.50 per month — delete it in cleanup. |
Clean up — delete everything when you finish. Deleting the resource group deletes the vault, the workspace, the action group, and the alert rule. The vault enters a soft-deleted state for 90 days because purge protection is on. It costs nothing while soft-deleted, and you cannot purge it early. That is exactly the protection you just practised. If you re-run the lab, pick a new unique vault name. A soft-deleted vault keeps its name reserved until the retention period expires (or the vault is recovered first).
az group delete --name rg-lab1 --yes --no-wait
In the portal: open Resource groups, select rg-lab1, select Delete resource group, type the name to confirm, and select Delete. Check the group is gone before you close the portal — if it is still listed after a few minutes, the delete is still running.
Worked cost estimate
All figures below are at time of writing (November 2026), in US dollars, for the Canada Central region. They come from the Azure Key Vault pricing page, the Azure Monitor pricing page, and the Azure pricing calculator. Prices change by region and over time, so run the same steps in the calculator before you quote a price to anyone.
Worked example: you run the lab in one day, then delete rg-lab1 the same day. Usage assumptions for the month are deliberately generous: 100 Key Vault secret operations (the lab itself needs about 10), about 0.01 GB of Key Vault audit logs ingested into Log Analytics, one scheduled log alert rule evaluated every 5 minutes, and email notifications only.
Pricing Calculator steps:
- Add Key Vault, tier Standard, region Canada Central, and enter 100 secret operations per month.
- Add Log Analytics (listed under Azure Monitor), pricing tier Pay-As-You-Go, region Canada Central, and enter 0.01 GB of Analytics Logs ingestion per month.
- Add Azure Monitor, Log alerts, frequency 5 minutes, and enter 1 alert rule.
- Add Action Groups with an email receiver only. There is no line to add: action groups are not billed, and email notifications carry no per-message charge on this page.
- Read the monthly total, then divide by 30 for the one-day cost, because the lab resources exist for one day, not one month.
| Resource | Tier | Monthly cost |
|---|---|---|
Resource group rg-lab1 | - | $0.00 |
Key Vault kv-lab1-<unique> | Standard | $0.00 (100 operations at $0.03 per 10,000 operations = $0.0003) |
Log Analytics workspace law-lab1 | Pay-As-You-Go | $0.00 (0.01 GB is inside the first 5 GB per month per billing account, which is free; above that, Analytics Logs are $2.30 per GB) |
Diagnostic setting kv-audit-to-law | - | $0.00 (routing logs is free; only ingestion at the destination is billed) |
Action group ag-oncall | - | $0.00 (email only; SMS and voice notifications are the ones that carry a charge) |
Scheduled log alert kv-failed-access-alert | 5-minute frequency | $1.50 per month if left running |
| Total | $1.50 per month if left running; about $0.05 for one day |
What drives the bill: the alert rule is the only real cost in this lab, and it is driven by evaluation frequency, not by how often it fires. A 5-minute rule costs $1.50 per rule per month. The same rule at 15 minutes costs $0.50 per rule per month, so slowing the frequency to 15 minutes cuts this lab's bill by two-thirds.
The vault is driven by operation count: at $0.03 per 10,000 secret operations, a single secret read every 5 minutes all month is still only about $0.03. Log Analytics is driven by ingestion volume: the first 5 GB per month is free, so one vault's audit logs cost nothing. But turning on verbose diagnostics for many
resources is what makes this meter jump.
What would make the bill jump: leaving the alert rule running for months, adding more alert rules, pointing many vaults or other resources at the same workspace, or switching to SMS or voice notifications in the action group.
Try it further Scenario: The company now rotates its payment password every month, and the on-call team wants proof that the alert actually fires instead of trusting that it will. In this challenge you rotate the DbPassword secret to a new value, then deliberately fail a secret read. Then you watch the failed access travel from the vault into the workspace and into your inbox. This uses only commands already in Lab 1. 1. Rotate the secret to a new value by hand (manual rotation — Key Vault has no built-in automatic rotation for secrets, so setting a new secret version is the rotation step). Use a practice password only, never a real production password:
az keyvault secret set --vault-name kv-lab1-<unique> --name DbPassword --value "ChangeMe-Rotated-Password-2!"
- Confirm the new version exists, showing only its metadata, not the value:
az keyvault secret show --vault-name kv-lab1-<unique> --name DbPassword --query id -o table
- Deliberately fail a read. Ask for a secret name that does not exist, and expect an error. The error is the point of this step:
az keyvault secret show --vault-name kv-lab1-<unique> --name DoesNotExist --query id -o table
- Wait a few minutes, then open
law-lab1, select Logs, and run the Lab 1 query from step 8 with one extra filter, to show only the failed attempt:
AzureDiagnostics | where ResourceProvider == "MICROSOFT.KEYVAULT" | where ResultType!= "Success" | project TimeGenerated, OperationName, ResultType, CallerIPAddress | take 10
- Wait up to 5 minutes for the next alert evaluation, then check the inbox of the email address in
ag-oncallfor the alert email. The rule evaluates every 5 minutes, so the email can take a few minutes after the failed read. 6. If no email arrives, do not assume the alert is broken. First re-run the query in step 4: if it returns no rows, the diagnostic setting is not delivering logs yet, so wait a few more minutes and try step 3 again. If the query returns rows but there is still no email, open the alert rulekv-failed-access-alertand check it is enabled and thatag-oncallis attached on its Actions tab. Expected result: theDbPasswordsecret holds the new rotated value. The Logs query returns at least one row with aResultTypeother thanSuccessfor the failed read. The alert email arrives in your inbox within about 10 minutes of step 3. Screenshot — capture this: the Log Analytics Logs blade showing the step 4 query returning the failed-access row, and the alert email in your inbox (hide or crop out any personal email content you do not want to share). Lab evidence: capture your own screenshot of the failed-access row in Logs and the alert email, and keep them with the Lab 1 evidence. A rotation nobody can prove and an alert nobody has seen fire are both untested. Cost note: rotating a secret and failing one read adds a handful of operations at $0.03 per 10,000, so about $0.00. No new resource is created. Deleterg-lab1as in the Lab 1 cleanup when you finish.
Chapter 1 addendum — Identity, governance, and monitoring
Common mistakes and exam traps — Identity, governance, and monitoring
- Treating Azure RBAC and Azure Policy as the same control. The exam shows an Owner who cannot deploy a VM in a forbidden region and asks what is missing. The trap is to add a bigger role. But RBAC answers "who may do something" while Policy answers "what may exist". So an Owner is still blocked by a Deny policy that evaluates the resource, not the person. The correct principle is to check the control that matches the question: access failures are RBAC, blocked or non-compliant resources are Policy.
- Assuming resource logs are collected by default. The exam describes a Key Vault or firewall with no logs in the workspace and tempts you to blame the workspace. Platform metrics are automatic. But resource logs are not collected or stored until you create a diagnostic setting and route them to a destination. The correct principle is that logging is opt-in per resource: no diagnostic setting, no resource logs, no matter how long the resource has been running.
- Confusing metrics with logs. The exam asks for the exact failed sign-in at 02:14 with its source IP, and offers a metrics chart as the answer. Metrics are sampled numbers (CPU percentage every minute) kept for 93 days. Logs are timestamped event records kept in a workspace for as long as you pay to retain them. The correct principle is to match the question to the data type. A single event with who, what, and when is a log question. A trend over time is a metrics question.
- Building an alert rule and forgetting the action group. The exam shows an alert that fires correctly while nobody is notified, and the tempting fix is to rebuild the alert rule. An alert rule only decides when something is wrong. The action group decides who is told and what runs. An alert without one notifies nobody. The correct principle is to always pair the two: a rule with no action group is a detector with no alarm.
- Calling SMS or push notification "phishing-resistant MFA". The exam says the design "must resist phishing" or "must resist MFA fatigue" and offers SMS, voice call, or an Authenticator push as options. SMS and voice are not phishing-resistant. Number matching only mitigates push fatigue. It does not make push phishing-resistant. The correct principle is that phishing-resistant means FIDO2 security keys, Windows Hello for Business, or certificate-based authentication.
- Enabling a Conditional Access policy straight to "On" with no break-glass exclusion. The exam describes administrators locked out of the tenant after a new policy, and tempts you to blame the MFA requirement itself. A policy that applies to every administrator with no excluded emergency-access account can lock out the whole tenant. Going straight to enforced mode means the impact was never measured. The correct principle is to exclude at least one cloud-only break-glass account from every blocking policy and to run new policies in report-only mode first.
- Answering an authorization problem with more authentication. The exam says "the right person got in but could do too much" and offers stronger MFA as the fix. Authentication proves who you are. Authorization decides what you may do. So excess privilege is an RBAC failure, not an authentication failure. The correct principle is to fix the role and its scope (narrowest role, narrowest scope, assigned to a group), because no amount of MFA removes permissions that should never have been granted.
- Recommending federation when password hash synchronization would do. The exam describes a standard hybrid identity design and offers AD FS federation as the "most secure" answer. Federation is only the right recommendation when a stated requirement demands it, such as smart
cards or a third-party identity provider at sign-in. It adds servers, certificates, and high-availability work. The correct principle is to recommend password hash synchronization with seamless single sign-on by default. It is simpler, it keeps working when the on-premises environment is down, and it enables leaked-credential detection.
- Assuming a Reader on a Key Vault can read its secrets. The exam gives a support engineer the Reader role on a vault and asks whether they can retrieve a database password. The tempting answer is yes, because they can "see" the vault. Reader is a management-plane role. It lets you see the vault exists. But reading a secret value is a data-plane action that needs a role such as Key Vault Secrets User. The correct principle is to keep the two planes separate in your head: management-plane roles manage the vault, data-plane roles read what is inside it.
- Assuming tags on a resource group flow down to its resources. The exam says "we tagged the resource group, so all resources are tagged for cost reporting" and asks why the cost report is empty. Tags do not inherit automatically. A tag on a resource group stays on the resource group. The resources inside it carry no tag until something adds it. The correct principle is to enforce tagging with an Azure Policy Modify effect that appends the tag, or to set tags in the infrastructure-as-code templates that deploy the resources.
Architect's decision checklist — Identity, governance, and monitoring
Use this checklist on exam day. If you cannot answer an item from the scenario, the scenario probably has not given you that fact — and the exam is testing whether you notice it is missing.
| Check | Why it matters |
|---|---|
| [ ] Retention: queryable vs archive — which destination? | Workspace = queryable with KQL and alerting; storage account = cheap long-term archive; event hub = streaming to a SIEM. The requirement's verb (query, archive, stream) picks the destination. |
| [ ] Resource logs: is there a diagnostic setting? | No diagnostic setting means no resource logs exist, however long the resource has run. |
| [ ] Log retention: does the workspace keep data long enough? | Entra sign-in and audit logs last only 30 days on P1/P2 (7 days on Free); longer retention needs routing to a workspace or storage account before they expire. |
| [ ] Alert: is there an action group behind it? | A rule without an action group fires silently. Check who is notified and what automation runs. |
| [ ] Alert signal: metric or log? | Metric alerts are near-real-time and cheap; log alerts evaluate on a schedule and cost per evaluation. |
| [ ] Identity: is this RBAC, Policy, or Conditional Access? | RBAC = who may act; Policy = what may exist; Conditional Access = conditions at sign-in. Picking the wrong one answers a different question. |
| [ ] Conditional Access: is a break-glass account excluded, and was it report-only first? | A policy with no exclusion can lock out every administrator; a policy never run in report-only mode has unmeasured impact. |
| [ ] MFA: phishing-resistant or just MFA? | "Must resist phishing" means FIDO2, Windows Hello for Business, or certificate-based authentication — never SMS, voice, or push alone. |
| [ ] Hybrid identity: PHS, PTA, or federation? Check | PHS is the default; PTA only when password hashes must not leave the premises; federation only for smart cards or a third-party identity provider. Why it matters |
| [ ] Secrets: managed identity or a stored secret? | A managed identity with Key Vault Secrets User leaves no credential anywhere; a service principal secret in code or config is the vulnerability. |
| [ ] Key Vault: is purge protection on for production vaults? | Purge protection cannot be disabled once enabled — which is exactly why it must be on before the incident, not after it. |
| [ ] Tags: are they enforced, or just applied once? | Tags do not inherit; a Modify policy or template is what makes tagging reliable. |
| [ ] Policy: Audit first, then Deny? | Going straight to Deny breaks legitimate deployments; Audit measures the blast radius first. |
| [ ] Stale access: PIM, access review, or entitlement management? | PIM = temporary privilege for admins; access review = "does this person still need this?"; entitlement management = time-limited access packages for guests and partners. |
End-of-chapter check questions (multiple choice)
Answer these without looking back, then check against the key. Each question has one correct answer.
The company needs to keep firewall logs queryable for 90 days and archived for seven years. Which two destinations should the diagnostic settings use?
A) A Log Analytics workspace for both querying and the seven-year archive B) A Log Analytics workspace (90-day retention, queryable with KQL) and a storage account (seven-year cheap archive) C) An event hub for both querying and the seven-year archive D) A storage account for querying and an event hub for the archive
A metric alert fires but nobody receives an email. What is the most likely missing component?
A) The KQL query is wrong B) The Log Analytics workspace was deleted C) No action group is attached to the alert rule D) The alert rule is disabled
Which authentication method should you recommend when a scenario requires phishing-resistant MFA?
A) SMS one-time codes B) Authenticator push notification on its own C) FIDO2 security keys, Windows Hello for Business, or certificate-based authentication D) A password plus SMS
Why is password hash synchronization usually recommended over federation for a standard hybrid identity design?
A) PHS is simpler, works when the on-premises environment is unavailable, and enables leaked-credential detection B) Federation is simpler and needs no on-premises servers C) PHS requires AD FS to be deployed first D) Federation keeps working when the on-premises environment is down
A developer needs to manage VMs in one resource group only and must not assign roles. Which RBAC role and scope?
A) Owner at the subscription scope B) Contributor at the resource group scope C) Reader at the resource group scope D) Contributor at the management group scope
What is the difference between Azure RBAC and Azure Policy?
A) RBAC controls who may do something; Policy controls what may exist B) Policy controls who may do something; RBAC controls what may exist C) They are the same control under two names D) Policy assigns roles; RBAC blocks deployments
A vault holding encryption keys was deleted by an administrator and cannot be recovered. Which Key Vault feature was missing?
A) Purge protection (with soft delete) B) A Key Vault Secrets User role assignment C) A private endpoint D) Soft delete was enabled, which is all that is needed
Tags applied to a resource group do not appear on the resources inside it. Why, and what fixes it?
A) Tags inherit automatically after 24 hours; wait B) Tags do not inherit automatically — fix it with an Azure Policy Modify effect that appends the tags, or with infrastructure-as-code templates C) Tags flow down only if the resource group is in the same region D) Tagging cannot be enforced, so the resources must be tagged by hand forever
Which governance tool answers "does this person still need this access?" on a schedule?
A) Privileged Identity Management (PIM) B) Access reviews (Microsoft Entra ID Governance, P2) C) Entitlement management D) Conditional Access
A new Deny policy is about to be assigned at the management group. What should you do first?
A) Assign it in Audit mode first (enforcement mode DoNotEnforce) to measure the blast radius, then move to Deny B) Assign it in Deny mode directly — measuring first wastes time C) Run it in report-only mode, as you would a Conditional Access policy D) Assign it in Deny mode, then delete any exemptions that appear
Answer key
Chapter 1 addendum — based on the official Microsoft AZ-305 exam objectives (skills measured April 17, 2026). Unofficial study material — not affiliated with or endorsed by Microsoft.
Want the full Microsoft Azure Solutions Architect Expert (AZ-305) package?
This guide is free to read. Get the downloadable PDF guidebook plus the full 700-question AZ-305 practice exam with 3 months of online access.
Get AZ-305 Full Access — $10