Microsoft Defender for Cloud (MDC) is Azure's cloud-native application protection platform — a CNAPP that fuses Cloud Security Posture Management (CSPM) with Cloud Workload Protection (CWPP). In plain terms: it continuously grades your configuration against a security benchmark, produces a running Secure Score, and layers threat detection on top of your VMs, containers, databases, storage and identities — across Azure, AWS, GCP and on-prem.
This guide walks the whole rollout three ways. You will enable Defender plans in the portal for a quick start, reproduce it with the Azure CLI for repeatability, then codify it in Bicep and Terraform so a hundred subscriptions look identical. After that we onboard AWS, GCP and physical servers via Azure Arc, tune the plans that matter, and export everything into Microsoft Sentinel.
It is written for the 2026 platform: foundational CSPM moving to an opt-in model for new subscriptions from 27 October 2026, multicloud connectors that now use short-lived federated credentials, and the deprecated pricing-plan API changes from mid-2026. Every command is copy-pasteable — swap in your own IDs and go.
◈ Table of Contents
01 — What It Is & Why It Matters
OVERVIEWDefender for Cloud has two engines working in tandem. CSPM is the posture side — it reads the control-plane configuration of every resource, compares it to the Microsoft Cloud Security Benchmark (MCSB), and surfaces recommendations such as "Storage account allows public blob access" or "SQL server has no auditing." Those recommendations roll up into a single Secure Score percentage that executives and engineers alike can track. CWPP is the workload side — the paid Defender plans that add runtime threat detection, agentless malware scanning, vulnerability assessment and behavioural alerts to servers, containers, databases and more.
Foundational (free) CSPM is available to every Azure subscription and gives you the Secure Score, asset inventory and MCSB assessment at no cost. The paid Defender CSPM plan unlocks the features defenders actually pivot on: agentless vulnerability and secret scanning, attack path analysis, and the Cloud Security Explorer graph. A blue team should think of the free tier as visibility and the paid tiers as detection and response.
Continuous Posture Grading
Every misconfiguration across Azure, AWS and GCP is scored against the MCSB and industry standards (CIS, NIST, PCI-DSS), giving you one Secure Score to drive remediation sprints.
Agentless Workload Scanning
Defender CSPM snapshots disks and scans them out-of-band for vulnerabilities, malware and plaintext secrets — no agent to deploy, no runtime performance hit.
Attack Path Analysis
The graph engine chains findings — internet-exposed VM → high-severity CVE → over-privileged managed identity → sensitive storage — so you fix the one node that breaks the chain.
Workload Threat Detection
Defender plans raise behavioural alerts — crypto-mining on a VM, anonymous access to a Key Vault, a malicious SQL injection — and stream them to Sentinel and the Defender XDR portal.
Turn on foundational CSPM everywhere before you spend a cent. It is free, it seeds the asset inventory, and it lets you size the paid plans against real resource counts instead of guessing.
From 27 October 2026, foundational CSPM becomes opt-in for newly created Azure subscriptions (it stays $0). If a brand-new subscription shows an empty Secure Score, you must explicitly enable it — it is no longer on by default.
02 — Prerequisites & Requirements
BEFORE YOU STARTDefender for Cloud has no server to install — it is a first-party Azure service. What you need is the right role, the right resource providers registered, and (for Defender for Servers Plan 2) a Log Analytics workspace to land data in. The table below is the whole checklist.
| Requirement | Detail | Notes |
|---|---|---|
| Azure subscription | Any active subscription | Free tier CSPM works on all; paid plans bill per resource. |
| RBAC role | Owner or Contributor to enable plans | Security Admin can change plans/policies; Security Reader is view-only. |
| Resource providers | Microsoft.Security, Microsoft.PolicyInsights | Microsoft.HybridCompute is also needed for Azure Arc onboarding. |
| Azure CLI | 2.60+ min | Needed for Methods 2 & 3. az upgrade to update. |
| Terraform | 1.6+ with azurerm provider 3.x/4.x | Optional — Method 3 only. |
| Log Analytics workspace | One per region (recommended) | Required for Defender for Servers Plan 2 file-integrity & 500 MB free data. |
Enabling Defender plans is a write operation on Microsoft.Security. You need Owner, Contributor or Security Admin at subscription scope. Sign in and confirm which subscription is active before you change anything.
If Microsoft.Security is not registered on the subscription, plan enablement silently fails or hangs. Register the providers once; registration is idempotent and takes a minute or two to reach Registered.
Do not skip provider registration on freshly created subscriptions. A missing Microsoft.Security registration is the single most common reason "enable all plans" appears to do nothing in automation.
03 — Method 1: Enable via the Azure Portal
GUI · FASTEST STARTThe portal is the fastest way to get a single subscription protected and to see the interface you will be scripting against later. Everything lives under Environment settings. Before diving in, here is how the three enablement methods in this guide compare so you can pick the right one for your scale.
| Method | Best for | Repeatable | Drift control |
|---|---|---|---|
| Azure Portal | 1 subscription, first look, demos | No — manual clicks | None |
| Azure CLI | A few subs, quick scripts, pipelines | Yes — scriptable | Weak (no state) |
| Bicep / Terraform | Many subs, audited estates, GitOps | Yes — declarative | Strong (state + PR review) |
In the Azure portal, use the top search bar and type Microsoft Defender for Cloud. Pin it to your favourites — you will live here. The Overview blade shows the Secure Score, active recommendations, and any resources not yet covered by paid plans.
In the left menu choose Environment settings. You will see your management-group and subscription tree. Click the subscription you want to protect — plan enablement is per-subscription (you can also set it at the management-group level to cascade down, covered in Phase 9).
The Defender plans page lists every plan with an On/Off toggle. For maximum coverage flip the master toggle to Enable all plans, or toggle individual plans for tighter cost control. When a plan is On it is billed at the "Standard" tier; Off is "Free".
- aToggle Defender CSPM on to unlock agentless scanning and attack path analysis.
- bToggle Servers on, then click its plan link and choose Plan 1 or Plan 2.
- cToggle on the workload plans you use: Storage, Containers, Databases, App Service, Key Vault, Resource Manager, APIs.
- dClick Save. Coverage begins within minutes; the first agentless scans complete within a few hours.
Every Defender plan has a "Settings" link exposing its sub-components — e.g. Servers → Agentless scanning, Vulnerability assessment, EDR integration. Enabling the plan enables sensible defaults; open Settings to fine-tune.
Under the same subscription blade, open Settings & monitoring. This controls what MDC deploys to workloads — the Log Analytics agent successor (Azure Monitor Agent), agentless scanning, and endpoint integration. Confirm Agentless scanning for machines is On and pick your Log Analytics workspace.
Return to Overview. The "Defender for Cloud coverage" tile should now report your protected resource count, and the Secure Score begins recalculating. Recommendations populate as the first assessment cycle runs.
- Environment settings shows plans as "On" for the subscription
- Overview coverage tile shows a non-zero protected resource count
- Secure Score displays a percentage (not "—")
- Recommendations list is populating with MCSB findings
04 — Method 2: Enable via the Azure CLI
REPEATABLE
Clicking toggles does not scale to dozens of subscriptions. The az security pricing command group enables the exact same plans from a script or pipeline. Each plan is a named resource; setting its tier to standard turns the plan on, free turns it off.
Before changing anything, capture the current tiers so you can diff and roll back. az security pricing list returns every plan and whether it is Free or Standard.
The plan name for the paid CSPM tier is CloudPosture. Enable it first, then the workload plans. Each command is a "create" that updates the plan to the Standard tier.
Servers is the plan with the most knobs. Use --subplan to pick Plan 1 (endpoint-focused) or Plan 2 (adds file integrity monitoring, agentless scanning, JIT and 500 MB free data ingestion). The --extensions flag toggles sub-components like agentless VM scanning.
Plan 1 covers endpoint detection and response via Defender for Endpoint integration. Choose Plan 2 only where you need file integrity monitoring, agentless scanning or just-in-time VM access — it costs more per server.
Loop the remaining plan names to switch everything on in one pass. This is the block you drop into a subscription-provisioning pipeline.
As of 5 July 2026, Microsoft blocked new onboarding through the plan-enablement API for five deprecated pricing plans. Existing subscriptions kept their access and billing, but do not script those legacy plan names into new automation — the call will error.
Re-run the list command. Every plan you enabled should now read Standard. Check an individual plan with show to confirm the subplan and extensions applied.
05 — Method 3: Bicep & Terraform (IaC)
AT SCALEInfrastructure-as-Code is how you keep a hundred subscriptions identical and audit-able. Both Bicep (Azure-native) and Terraform (multicloud) model each Defender plan as a resource. Commit these files to Git and your MDC posture becomes a reviewable pull request.
Save the following as defender.bicep. It targets subscription scope and enables the key plans, including Servers Plan 2 with agentless scanning. Extend the array with any plan name from Method 2.
Subscription-scoped deployments use az deployment sub create with a location for the deployment metadata (the plans themselves are global). Run a what-if first to preview the change.
If your estate is multicloud, Terraform keeps Azure, AWS and GCP in one workflow. The azurerm_security_center_subscription_pricing resource maps one-to-one to a Defender plan via its resource_type argument.
Standard Terraform loop. Always review the plan output — you should see one resource per Defender plan being created or updated.
Do not manage the same plans in both Bicep and Terraform — or in IaC and a portal DINE policy — at once. Two controllers fighting over one plan resource produces perpetual drift and noisy deployment diffs. Pick one source of truth.
06 — Initial Configuration
FIRST-RUN TUNINGPlans are on; now make the data useful. First-run configuration is about pointing MDC at the right benchmark, confirming agentless scanning has a workspace, and understanding the Secure Score you are about to spend months improving.
The Microsoft Cloud Security Benchmark is assigned by default at subscription scope — it is the initiative that drives your recommendations and Secure Score. Confirm it exists under Environment settings → Security policy. If you enabled MDC at management-group scope, the assignment should inherit down.
Defender for Servers Plan 2 features and continuous export land in a Log Analytics workspace. Create one (or reuse your Sentinel workspace) and set it as the default for auto-provisioned data. Co-locating with Sentinel avoids cross-workspace query pain later.
Use one workspace per region and keep Defender for Cloud and Sentinel on the same workspace. It halves your ingestion configuration and lets a single KQL query span posture data and SIEM events.
Secure Score is a weighted percentage of MCSB controls you satisfy. Each control groups related recommendations; fixing the highest-weighted, lowest-effort controls first gives the biggest score jump. Pull the current score and top recommendations from the CLI to snapshot your starting point.
ATTACK PATH ANALYSIS — Defender CSPM correlates individual findings into an exploitable chain.
07 — Defender Plans Deep Dive
WHAT EACH PLAN BUYSCost control comes down to enabling the right plan on the right resource. Here is what each plan actually protects and its indicative billing model. Exact prices vary by region and currency — always confirm on the live pricing calculator before you commit budget.
| Plan (CLI name) | Protects | Key Features | Billing model |
|---|---|---|---|
| CloudPosture | All resources | Agentless scanning, attack paths, Cloud Security Explorer, secret scanning | Per billable resource |
| VirtualMachines | Azure/Arc VMs | P1: EDR integration · P2: +FIM, JIT, agentless, 500 MB free logs | Per server/hour (~$15/server/mo P2 indicative) |
| StorageAccounts | Blob/Files | Malware scanning on upload, sensitive data threat detection | Per storage account + per-GB scanned |
| Containers | AKS/ARO/EKS/GKE | Registry image scanning, Kubernetes runtime threat detection | Per vCore |
| SqlServers | Azure SQL | Vulnerability assessment, anomalous query & SQLi detection | Per SQL server/instance |
| KeyVaults | Key Vault | Anomalous access & suspicious secret-enumeration alerts | Per vault + per 10K transactions |
| Arm | Resource Manager | Control-plane abuse detection (e.g. suspicious role grants) | Per subscription |
| Api | API Management | API discovery, exposed-secret & abnormal-traffic detection | Per API |
Plan 1 is essentially Microsoft Defender for Endpoint provisioned to your servers plus its alerts, priced lower per machine. Plan 2 adds the posture-heavy capabilities. Map the decision to what you need: if you only want EDR, Plan 1; if you need file integrity monitoring, just-in-time access or agentless scanning, Plan 2.
| Capability | Plan 1 | Plan 2 |
|---|---|---|
| Defender for Endpoint integration (EDR) | ✔ | ✔ |
| Vulnerability assessment | ✔ | ✔ |
| Agentless disk scanning | — | ✔ |
| File Integrity Monitoring (FIM) | — | ✔ |
| Just-in-Time VM access | — | ✔ |
| 500 MB/day free log ingestion | — | ✔ |
| Relative cost per server | Lower | Higher (~$15/mo indicative) |
You can set the Servers plan at resource level, not just subscription level. Put Plan 2 on your crown-jewel servers and Plan 1 (or off) on ephemeral scale-set nodes to control spend.
The Storage plan's on-upload malware scanning is one of the highest-value, lowest-effort detections — it catches malicious files landing in blob containers that feed downstream apps. Enable the malware scanning component and cap the monthly GB to bound cost.
Because billing is per-resource, cost scales with your estate. Microsoft's 2026 commit-based option (Defender for Cloud Commit Units) offers discounts of up to roughly 22% versus pay-as-you-go if you can forecast usage. Model both before enabling estate-wide.
- 1Use the free CSPM asset inventory to count VMs, storage accounts and SQL instances.
- 2Multiply by the per-resource rate from the pricing calculator for your region.
- 3Compare pay-as-you-go against a Commit Units tier for the same volume.
Defender for Storage per-GB scanning charges can spike on high-throughput accounts (log sinks, data-lake landing zones). Set the monthly scanning cap, and exclude buckets that only ever receive machine-generated data you already trust.
08 — Multicloud & Integration
AWS · GCP · ARC · SIEMMDC is only a single-cloud tool if you leave it that way. The real value for most SOCs is one posture-and-detection pane across Azure, AWS, GCP and on-prem, feeding one SIEM. This phase connects the other clouds and pushes findings to Sentinel.
Azure Arc projects a non-Azure machine into Azure as a resource, so Defender for Servers can protect it. Install the Connected Machine agent on the target server, then connect it. Generate a service-principal or use device login for the connect step.
Once a server shows up as an Arc "Connected Machine", enabling Defender for Servers at the subscription level automatically covers it — no separate MDC onboarding step for that host.
In Environment settings → Add environment → AWS, MDC generates a CloudFormation (or Terraform) template you deploy in the AWS account. As of the August 2026 update, the connector uses short-lived federated credentials — no long-lived AWS secret is stored — and offers a "least privilege" versus "default access" toggle. Choose least privilege unless you need full CWPP on EC2.
- aName the connector and enter the AWS account ID.
- bSelect plans to project: CSPM, Servers, Containers, Databases.
- cDownload the CloudFormation template and deploy it in the AWS account to create the federated role.
- dBack in Azure, click Create. AWS resources appear in the inventory within a few hours.
The GCP flow mirrors AWS: Add environment → GCP, supply the organization or project ID, pick plans, and run the generated GCP Cloud Shell script that provisions a workload-identity federation. Like AWS, the 2026 flow dropped long-lived service-account keys in favour of short-lived federated tokens.
Multicloud connectors need the federation role/identity to persist. If someone deletes the CloudFormation stack or GCP workload-identity pool, the connector goes stale and silently stops reporting — monitor connector health, not just Azure resources.
To correlate MDC alerts with the rest of your telemetry, connect them to Sentinel. Use the Tenant-based Microsoft Defender for Cloud data connector (or the Defender XDR connector) so alerts and, optionally, recommendations flow into the SecurityAlert table. You can also use continuous export for a raw feed.
09 — Advanced Configuration
POWER USEROnce the basics are live, the advanced controls turn MDC from a scorecard into an operational tool: hunting the resource graph, governing remediation with SLAs, adding compliance standards, and pulling code security into the same view.
Cloud Security Explorer (a Defender CSPM feature) lets you query the security graph directly — "show me all internet-exposed VMs with a high-severity vulnerability and a managed identity that can read a storage account." You can reproduce much of the underlying inventory query with Azure Resource Graph for pipelines and reporting.
Governance rules assign owners and remediation due-dates to recommendations, so findings do not rot. Under Environment settings → Governance rules create a rule that auto-assigns any new high-severity recommendation to the resource owner with a 14-day SLA. Then add the compliance standards you are audited against under Regulatory compliance.
- aGovernance rules → New rule → scope to subscription, severity = High, SLA = 14 days.
- bRegulatory compliance → Manage compliance policies → add CIS, NIST 800-53 or PCI-DSS.
- cUse exemptions for accepted risks so they stop dragging the score — with a justification and expiry.
Set an expiry on every exemption. A permanent exemption is an invisible risk acceptance that no one revisits; a 90-day expiry forces the conversation again.
The DevOps security connector brings code, secret and IaC scanning findings from your repositories into the same Defender for Cloud recommendations view — shifting posture left of deployment. Add it under Environment settings → Add environment → GitHub / Azure DevOps and authorize the connection.
10 — Monitoring, Maintenance & Troubleshooting
DAY-2 OPSDay-2 is where value is realised or lost. Prove alerts fire, watch the score trend, automate the boring responses, and know how to debug the handful of things that commonly break.
Before you trust MDC in an incident, prove the pipeline end to end. The Security alerts blade has a Sample alerts button that injects benign test alerts for each enabled plan — confirm they appear in MDC, in Sentinel's SecurityAlert table, and trigger your automation.
Run a sample alert on the same day you connect Sentinel. It is the cleanest way to confirm the connector, the ingestion delay, and any analytics rule that should fire — all at once.
Workflow automation ties a Logic App to an alert or recommendation trigger — post to Teams, open a ticket, isolate a VM. Configure it under Environment settings → Workflow automation, bind it to the alert severity you care about, and point it at a Logic App.
- aCreate a Logic App with the "When a Defender for Cloud alert is created" trigger.
- bWorkflow automation → New → scope to subscription, condition Severity = High.
- cSelect the Logic App as the action and save. Test it with a sample alert.
Common Errors & Fixes
| Symptom | Likely Cause | Fix |
|---|---|---|
| "Enable all plans" does nothing in a script | Microsoft.Security provider not registered | az provider register --namespace Microsoft.Security, wait for Registered. |
| Secure Score shows "—" on a new sub | Foundational CSPM opt-in (post-27 Oct 2026) | Explicitly enable foundational CSPM on the subscription. |
| Arc server not covered by Defender | Servers plan off, or agent not connected | Confirm azcmagent show = Connected and Servers plan = Standard. |
| AWS/GCP resources stopped appearing | Federation role/stack deleted | Redeploy the connector's CloudFormation / workload-identity, check connector health. |
| No alerts reaching Sentinel | Data connector not enabled or wrong workspace | Enable the Tenant-based MDC connector; verify continuous export workspace ID. |
| Unexpected Defender for Storage bill | Per-GB scanning on a high-throughput account | Set monthly scanning cap; exclude trusted machine-data buckets. |
| CLI: plan name not accepted | Deprecated legacy plan (post-5 Jul 2026) | Use a current plan name; remove legacy names from automation. |
Enabling a plan bills immediately, but disabling does not refund retroactively. When testing in a lab subscription, script the teardown (az security pricing create -n <plan> --tier free) into your cleanup so a forgotten Plan 2 does not quietly accrue charges.
11 — Sources & References
DOCSOfficial Microsoft documentation for the commands, plans and connectors used in this guide. Always confirm current pricing on the live calculator before committing budget.
Take Your Cloud Defence Further
You have MDC grading and defending your estate. Pair it with a SIEM you actually hunt in — our Sentinel and detection-engineering guides pick up exactly where this one ends.
📝 More Guides 📚 Browse Courses◈ Stay Connected
Follow CyberHawk Threat Intel for threat intelligence, deployment guides and hands-on SOC tooling content.
"They can't exploit you if you are the Exploit."