Skip to main content

Onboarding Azure subscriptions, AWS accounts and GCP projects

Microsoft documentedDefender for Cloud · Source checked 2026-10-22 · Not yet verified in tenant · Sources: [1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17][18][19][20][21][22][23][24][25][26][27][28][29][30]

What it is​

Defender for Cloud has three front doors. An Azure subscription walks in on its own: open the blade once and the Microsoft.Security provider is registered, the Microsoft cloud security benchmark (MCSB) initiative is assigned, and Foundational CSPM, recommendations, inventory, secure score and the compliance dashboard are on for free. Paid plans are a second step, per subscription or, with Azure Policy, per management group.

AWS and GCP come in through a security connector, an Azure resource of type Microsoft.Security/securityConnectors in a subscription and resource group you pick. Behind it, a CloudFormation template or a gcloud script creates roles, an identity provider or workload identity pool, and plan-specific resources in the other cloud. Defender for Cloud reads that cloud with federated, short-lived credentials. No access keys are stored.

Product context is in the overview, plan choice in workload plans, and getting the MDE sensor onto servers afterwards in onboarding through Defender for Cloud.

One check before you start: an AWS account already connected to Microsoft Sentinel cannot be connected to Defender for Cloud until you follow the Sentinel-connected AWS guidance.

Licensing and prerequisites​

  • Foundational CSPM is free on every connected subscription, account and project. Defender CSPM, Servers, Containers, SQL and open-source databases are paid. The 30-day trial covers them except malware scanning in Defender for Storage, which bills from day one.
  • Azure roles: Reader or Security Reader to view. Contributor, Security Admin or Owner to enable or disable plans. Owner to unlock every capability of a plan and to add initiatives or standards. The management group onboarding page asks for Security Admin.
  • AWS connector: Contributor on a subscription with Defender for Cloud enabled, access to the AWS account. Defender CSPM wants Owner plus IAM rights to assume the monitoring role. CIEM needs Security Admin plus Application.ReadWrite.All during onboarding. Servers needs Owner for Arc auto-provisioning and the SSM Agent with AmazonSSMManagedInstanceCore on each EC2 instance. Containers needs an EKS cluster and room for an SQS queue, a Firehose stream and an S3 bucket in the cluster region.
  • GCP connector: same Azure side. The script's project needs the iam, sts, cloudresourcemanager, iamcredentials and compute APIs enabled; the script can do it. Servers needs Owner and the OS Config agent for Arc.
  • Not available: the AWS connector in Azure Government or 21Vianet. For AWS organizations only the management account works.
  • Workspace: the Log Analytics agent retired in August 2024. Only the Azure Monitor Agent for Defender for SQL servers on machines still needs one; FIM data also lands in one.

How it works​

Azure: scopes, Azure Policy and MCSB​

The management group tree scopes everything on the Azure side. The root group's ID is the tenant ID, new subscriptions land in it by default, and policy and RBAC assigned in the tree are inherited by every child. Resource Manager caches the hierarchy for up to 30 minutes.

Defender for Cloud rides that inheritance twice. Standards first: MCSB is assigned per subscription when Defender for Cloud is enabled, and the scale guide says to assign it once at the root group instead so every future subscription inherits it. AWS accounts get MCSB plus AWS Foundational Security Best Practices by default; GCP projects get MCSB plus GCP Default.

Plans second. Pricing is a per-subscription resource, Microsoft.Security/pricings/<planName>, with pricingTier of Free or Standard. A management group cannot hold one. It can hold a DeployIfNotExists policy that creates one in every child subscription. Learn's built-in "Enable Microsoft Defender for Cloud on your subscription" registers the subscription with pricingTier defaulting to free; a remediation task catches subscriptions that already exist. For paid plans there is "Configure Azure Defender for Servers to be enabled" and the "Configure Microsoft Defender for Cloud plans" initiative of twelve DINE policies. The pricings API also has enforce: set True at subscription level and descendants cannot override.

A subscription runs Plan 1 or Plan 2 of Defender for Servers, never both. For both, split subscriptions into two management groups with a policy each.

Agents today​

Policy-based components arrive through DeployIfNotExists policies at subscription level.

ComponentPlanTargetsPolicy-based
Azure Monitor AgentDefender for SQL servers on machinesAzure VMs, Arc machinesYes, Owner needed
MDE extension MDE.Windows / MDE.LinuxDefender for ServersAzure VMs, Arc machinesNo, provisioned by the integration
Vulnerability assessmentDefender for ServersAzure VMs, Arc machinesYes
Guest configurationNone requiredAzure VMs only, previewYes
Azure Arc agentServers, SQL on machines, ContainersMulticloud and on-premAuto-provisioned on EC2 and GCE by the connector
Defender sensor and Azure Policy for KubernetesDefender for ContainersAKS, Arc-enabled KubernetesYes

Agentless scanning is the other path. Defender CSPM or Servers Plan 2 snapshot each running VM's disks, analyse the copy in an isolated regional environment, keep only metadata, and delete the snapshot within minutes. It runs every 24 hours on a fixed schedule and skips machines that are off. It covers software inventory, vulnerabilities, secrets, EDR settings and, on Plan 2 only, malware. Azure grants the VM scanner operator role automatically. AWS gets a scanner role with snapshot and KMS rights, tag-scoped to CreatedBy = Microsoft Defender for Cloud. GCP gets MDCAgentlessScanningRole with compute.disks.createSnapshot and compute.instances.get, plus the KMS encrypter/decrypter role for CMEK disks.

AWS: what the connector creates​

The template creates an OpenID Connect identity provider bound to a Microsoft-managed Entra application, and one IAM role per capability whose trust policy only that federated identity can satisfy. Defender for Cloud gets an Entra token, presents it to AWS STS, and STS checks audience, signature, thumbprint and role conditions before issuing temporary credentials.

Roles by plan: CspmMonitorAws for read-only discovery, DefenderForCloud-AgentlessScanner for snapshots and KMS, SensitiveDataDiscovery for S3, DefenderForCloud-Ciem and DefenderForCloud-OidcCiem for STS, DefenderForCloud-DefenderForServers for JIT, DefenderForCloud-ArcAutoProvisioning for the SSM and IAM actions that install Arc, DefenderForCloud-DataSecurityPostureDB for RDS. Containers has its own set.

A management account connector deploys a StackSet to every member account, then auto-creates a member connector per account, new ones included. Editing the management connector edits the members; deleting it deletes them. The management account still needs its own stack. Defender for Servers tags Arc resources with AccountId, Cloud, InstanceId and MDFCSecurityConnector, and the template adds a 30-day automation scan that checks each EC2 instance has the IAM profile SSM needs. Arc servers for deleted instances, or ones Disconnected or Expired, are removed after seven days.

GCP: workload identity federation​

The gcloud script creates a workload identity pool, one provider per plan, service accounts, and project-level IAM bindings. Defender for Cloud gets an Entra token signed RS256 and valid for an hour, exchanges it at Google STS, which validates audience and signature against the provider, then impersonates the service account with the Google token. Organization onboarding scopes access to the organization's projects; single project onboarding to that project.

Arc auto-provisioning on GCP goes through VM Manager and the OS Config agent. Defender for Cloud does not install that agent, but it can flip an installed idle one from inactive to active, which GCP bills. Instances without Arc appear under "GCP VM instances should be connected to Azure Arc" with a Fix button. Tags: Cloud, InstanceName, MDFCSecurityConnector, MachineId, ProjectId, ProjectNumber.

Multicloud inventory and scan interval​

Once a connector is healthy, AWS and GCP resources sit in Inventory next to Azure ones; filter by Resource type and Environment. Connectors scan every 4, 6, 12 or 24 hours, but some collectors run hourly regardless, on GCP ComputeInstance, ContainerCluster, instance groups and Artifact Registry. Changing region or interval needs no rerun of the template or script; changing plans or features does.

Configure​

Enable plans on one Azure subscription​

  1. Azure portal > Microsoft Defender for Cloud > Environment settings.
  2. Pick the subscription or workspace.
  3. Enable all, or toggle plans, then Save. Each plan deploys its monitoring components from here. Turning a plan off stops collection after a short time but leaves extensions installed.
Environment settings is where every subscription, connector and workspace is listed. Source: Microsoft Learn, CC BY 4.0.
Environment settings is where every subscription, connector and workspace is listed. Source: Microsoft Learn, CC BY 4.0. · captured 2026-10-22
Defender plans page with the Enable all button. Expect the 30-day trial clock to start. Source: Microsoft Learn, CC BY 4.0.
Defender plans page with the Enable all button. Expect the 30-day trial clock to start. Source: Microsoft Learn, CC BY 4.0. · captured 2026-10-22

Enable at management group scope​

  1. Register the provider at the management group: az provider register --namespace Microsoft.Security --management-group-id <mgId>.
  2. Azure Policy > Definitions > "Enable Microsoft Defender for Cloud on your subscription" > Assign, scope the management group. No parameters needed.
  3. Remediation > Create a remediation task, so existing subscriptions get onboarded, not just new ones.
  4. Review + create > Create.
  5. For paid plans assign "Configure Microsoft Defender for Cloud plans" or "Configure Azure Defender for Servers to be enabled" the same way. The enable policy defaults pricingTier to free; set standard in the deployment to switch plans on. Its existenceCondition counts free and standard as compliant; tighten to standard if compliance should mean paid.
Assigning the enable policy at management group scope. Source: Microsoft Learn, CC BY 4.0.
Assigning the enable policy at management group scope. Source: Microsoft Learn, CC BY 4.0. · captured 2026-10-22

Settings and monitoring toggles​

Environment settings > subscription > Defender for Servers > Settings. Learn lists four:

ToggleDefaultPlanNotes
Vulnerability assessmentOnP1 or P2MDVM through the MDE sensor
Endpoint protectionOnP1 or P2MDE integration plus automatic sensor provisioning. Security Admin or Owner to change
Agentless scanning for machinesOn when P2 or Defender CSPM is onP2 or CSPMOne switch per environment, no per-capability control. Exclude machines by tag on the linked page
File integrity monitoringOffP2Needs a workspace
Agentless scanning for machines under Settings and monitoring. Allow 24 hours for the first scan. Source: Microsoft Learn, CC BY 4.0.
Agentless scanning for machines under Settings and monitoring. Allow 24 hours for the first scan. Source: Microsoft Learn, CC BY 4.0. · captured 2026-10-22

Add an AWS connector​

  1. Environment settings > Add environment > Amazon Web Services.
  2. Name, then Onboard: Management account or Single account.
  3. AWS regions (all ticked by default), connector Subscription, Resource group, Location, scan interval, AWS account ID. Management account only: account IDs to exclude.
Account details step: onboard type, regions, connector location, interval, account ID. Source: Microsoft Learn, CC BY 4.0.
Account details step: onboard type, regions, connector location, interval, account ID. Source: Microsoft Learn, CC BY 4.0. · captured 2026-10-22
  1. Next: Select plans. Each plan row has Settings for features such as Arc auto-provisioning and agentless scanning.
  2. Configure access. Default access covers current and future capabilities; Least privilege covers only today and asks again later.
  3. CloudFormation or Terraform. Host the template in your own S3 bucket, or let AWS create one, which can trigger the "S3 buckets should require requests to use Secure Socket Layer" recommendation. Learn gives a bucket policy for that.
  4. Run the stack. A management account needs a stack and a StackSet. "You must enable organizations access to operate a service managed stack set" means trusted access is off; enable it on the StackSets page and rerun.
Configure access: permission type and the CloudFormation or Terraform template. Source: Microsoft Learn, CC BY 4.0.
Configure access: permission type and the CloudFormation or Terraform template. Source: Microsoft Learn, CC BY 4.0. · captured 2026-10-22
  1. Next: Review and generate > Create. Recommendations appear within a few hours.

Update the stack whenever you add a plan, change plan features, Microsoft ships a new template, or you see AccessDenied, EntityAlreadyExists or Lambda runtime errors.

Add a GCP connector​

  1. Environment settings > Add environment > Google Cloud Platform.
  2. Subscription, Resource group, Location, scan interval.
  3. Organization: organization ID, optional project numbers and folder IDs to exclude. Single project: project number and project ID.
  4. Next: Select plans. All default to On. Defender for Servers Settings holds the Azure Arc agent toggle; Off means you install Arc yourself.
  5. Next: Configure access. Pick the permissions type, copy the generated gcloud script and run it in Cloud Shell in the scope being onboarded.
Configure access for GCP: the script is generated from the scope and plans you picked. Source: Microsoft Learn, CC BY 4.0.
Configure access for GCP: the script is generated from the scope and plans you picked. Source: Microsoft Learn, CC BY 4.0. · captured 2026-10-22
  1. Next: Review and generate > Create.

Regenerate and rerun the script when plans, features or scope change, Microsoft updates it, or connector health reports missing permissions.

Remove a connector​

Environment settings > the connector > Delete. Deleting a management account connector deletes its member connectors. If the delete fails, look for a resource lock in the Activity log. Learn does not say what stays behind in AWS or GCP. TODO: confirm in the lab; expect the stack, IAM roles, OIDC provider, workload identity pool and service accounts to remain until deleted there.

Verify​

  • Environment settings > Connectivity status. Click through to Environment details for each permission or configuration issue, with remediation steps and sometimes a script.
Environment details for an AWS connector. This is the first place to look when posture data stops. Source: Microsoft Learn, CC BY 4.0.
Environment details for an AWS connector. This is the first place to look when posture data stops. Source: Microsoft Learn, CC BY 4.0. · captured 2026-10-22
  • Inventory, filtered by Resource type and Environment, with the Defender for Cloud column On.
  • Coverage workbook for plan state per subscription and resource.
  • Resource Graph for the connector resource:
resources
| where type =~ "microsoft.security/securityconnectors"
| project name, location, env = properties.environmentName, id = properties.hierarchyIdentifier
  • AWS: CloudTrail Lake or Athena, filter userIdentity.arn on assumed-role/CspmMonitorAws/MicrosoftDefenderForClouds_<tenantId>.
  • GCP: Log Explorer with protoPayload.authenticationInfo.principalEmail : "microsoft-defender".
  • Agentless: a green toggle proves nothing. Check a test machine has results within 24 hours.
  • Management group policy: Azure Policy > Compliance. Unregistered subscriptions show non-compliant until the remediation task runs.

Troubleshoot​

SymptomLikely causeFix
Connector shows Not healthyTemplate or script out of date after a plan change, or a role missingOpen Environment details, run the remediation steps, regenerate and rerun the template or script
No AWS data at allConnector subscription not selected in the Directories + subscriptions filter, or the account was connected to Sentinel firstFix the portal filter. For Sentinel, follow the Sentinel-connected AWS article and edit the template
New AWS root account, nothing appearsToo earlyWait at least 12 hours after the root account was created
CloudFormation Access deniedRunning user lacks IAM rights, or StackSet trusted access is offUse a role with the proper IAM permissions, enable organizations trusted access, rerun
CloudFormation Already exists or duplicate resourceGlobal resources created in more than one regionDeploy in one region first, remove leftovers, retry
CloudFormation unsupported Lambda runtimeOld templateDownload the latest template and update the stack or StackSet
StackSet hangs in the portalOrchestration or trusted access issueEnable trusted access, update the StackSet manually from the AWS console or CLI
Azure connector error after a successful stackStack name or settings do not match what the connector expects, or the member stack is missingAlign names, make sure both management and member stacks exist, retry from the portal
GCP onboarding failsMissing compute.regions.list, no Entra right to create the service principal, or WorkloadIdentityPoolId, WorkloadIdentityProviderId, ServiceAccountEmail missing in the projectGrant the permission, rerun the script, check the resources exist
GCP connector cannot fetch onboarding filesArc endpoints blockedAllow the Azure Arc endpoints through the firewall
GCP agentless results never arriveOrganization policy blocks disk, image or snapshot access, or Domain Restricted Sharing, or VPC Service ControlsSee the three GCP resolve articles linked from the troubleshooting page
EC2 instances never get ArcSSM Agent missing or no AmazonSSMManagedInstanceCore profile, or Owner missing on the subscriptionInstall SSM Agent, attach the profile, wait for the 30-day automation scan or fix the instance manually
GCE instances never get ArcOS Config agent not installed, or Azure Arc agent toggle OffInstall OS Config, or use the Fix on the GCP VM instances should be connected to Azure Arc recommendation
Arc machines vanished from Defender for CloudInstance deleted, or Arc status Disconnected or Expired for seven daysExpected cleanup. Reconnect live machines
Agentless scans stopped on AWS250 or more Defender-tagged snapshots accumulated because ec2:DeleteSnapshot failedGrant delete on snapshots tagged CreatedBy=Microsoft Defender for Cloud, check SCPs and permission boundaries
Connector delete failsResource lockCheck the Activity log, remove the lock, retry
Second connector for the same account refusedOne connector per cloud account per Entra tenantDelete the stale connector first
Policy at management group shows compliant but plans are offDefault existenceCondition counts free as compliantChange the condition to standard only and set pricingTier in the deployment

Gotchas and limits​

  • Management group cost surprise. A DINE policy with pricingTier at standard turns paid plans on in every subscription that ever joins the group, sandboxes included. Agree it with whoever pays before assigning at root, and decide whether enforce should lock it.
  • Plan 1 and Plan 2 of Defender for Servers cannot share a subscription. Policy at scale means two management groups.
  • Enable all starts the 30-day clock on every plan. Storage malware scanning bills from day one.
  • Workspace region. The Defender for SQL on machines initiatives create a workspace in the machine's region, one per region, unless you use the user-defined workspace variant. Posture data lives in the Defender for Cloud backend by tenant geography, not your workspace.
  • AWS regions. All ticked by default. CSPM read-only calls hit every selected region several times a day and land in CloudTrail; the calls are free, your SIEM ingestion is not. Filter CspmMonitorAws or trim regions. Open-source databases skips Tel Aviv, Milan, Jakarta, Spain and Bahrain.
  • Least privilege access is a snapshot. New resource types stay invisible until you rerun the template or script.
  • Agentless. The AWS scanner role carries kms:CreateKey for a DefenderForCloudKey alias; reviewers will ask. Azure CMK disks need Get, Wrap Key and Unwrap Key for application ID 0c7668b5-3260-4ad0-9f53-34ed54fa19b2. VMs over 14 disks are skipped, over 4 TB only the OS disk is scanned, and UltraSSD, Premium v2, ReFS, ZFS, UFS, Databricks VMs and licensed Marketplace AMIs are out.
  • Connector deletion leaves cloud-side resources. Nothing in the delete flow reaches into AWS or GCP. TODO: verify the cleanup order in the lab.
  • Enabling Servers on GCP can wake an idle OS Config agent, which GCP charges for.
  • Keep a portal view under 10,000 resources.
  • Set-AzSecurityPricing on CloudPosture leaves agentless extensions off unless passed.
  • The multicloud Learn URL now redirects to the security policy concept page and enable-all-plans to the Azure subscription page. The watcher will see that.

Further reading​

Only three qualified in the window. Jakub Fras's inventory deep dive and Microsoft's AWS and GCP cleanup guide are good but undated inside it.

My notes​

TODO: Sohail's notes after verification.

Changelog​

DateChangeSource
2026-10-22Drafted from Learn, with Learn images and diagrams[1]