← All articlesSecurity

Securing Azure with Microsoft Defender for Cloud

Ishfaq Nazir · Microsoft & Azure Cloud Security Architect 5/3/2026 5 min read

Securing Azure with Microsoft Defender for Cloud

Introduction

In the rapidly evolving landscape of cloud computing, security is not just a feature; it's a foundational imperative. As organizations increasingly migrate their workloads, data, and applications to Azure, the responsibility of safeguarding these assets becomes paramount. This article delves into Microsoft Defender for Cloud, a comprehensive cloud native application protection platform (CNAPP) that provides unified security management and advanced threat protection across hybrid and multi-cloud environments.

This guide is intended for cloud architects, security engineers, DevOps professionals, and IT administrators tasked with securing Azure resources. Whether you are establishing a new cloud security posture, enhancing an existing one, or striving for regulatory compliance, understanding and leveraging Defender for Cloud is crucial for maintaining a robust security stance in the cloud.

Why this matters

The "why" behind robust cloud security is multi-faceted, encompassing everything from financial impact to brand reputation. Unsecured cloud resources can lead to data breaches, regulatory non-compliance, and operational disruptions, all of which carry significant costs. Defender for Cloud addresses these concerns by providing proactive identification of vulnerabilities, real-time threat detection, and streamlined security operations that can significantly reduce mean time to respond (MTTR).

From a business perspective, effective security posture management and threat protection enabled by Defender for Cloud contribute to maintaining trust with customers and stakeholders, which is invaluable in today's digital economy. Technically, it helps organizations meet stringent compliance requirements (e.g., PCI DSS, ISO 27001, HIPAA) through continuous assessment and reporting. Moreover, by automating security tasks and centralizing visibility, Defender for Cloud enhances productivity for security teams, allowing them to focus on high-impact strategic initiatives rather than reactive firefighting. This ultimately translates to reduced operational overhead and improved overall risk management.

Key concepts

  • Cloud Security Posture Management (CSPM): Continuously assesses the security configuration of your cloud resources, identifying misconfigurations and vulnerabilities. It provides a secure score to help prioritize remediation efforts.
  • Cloud Workload Protection (CWP): Offers advanced threat protection capabilities for various workloads, including virtual machines, containers, databases, storage, and networking components, across hybrid and multi-cloud environments.
  • Secure Score: A numerical representation of an organization's security posture, based on the recommendations generated by Defender for Cloud. A higher score indicates a better security posture.
  • Recommendations: Actionable steps provided by Defender for Cloud to improve your secure score and address identified vulnerabilities. These are aligned with security controls and compliance standards.
  • Regulatory Compliance: Defender for Cloud helps monitor and report on your compliance against various industry standards and regulatory benchmarks by mapping your security posture to these controls.
  • Defender plans: A collection of security capabilities grouped by resource type (e.g., Defender for Servers, Defender for Storage, Defender for SQL). These plans enable specific CWP features.

Step-by-step implementation

  1. Enable Microsoft Defender for Cloud:

Navigate to the [Azure portal](https://portal.azure.com). Search for "Microsoft Defender for Cloud" and select the service. From the Defender for Cloud overview page, click on "Environment settings" in the left-hand navigation. Select the subscription or management group you wish to protect. * Under "Defender plans," review the available plans. We recommend enabling all relevant plans to get a comprehensive security posture and threat protection. For example, toggle on "Defender for Servers," "Defender for Storage," and "Defender for SQL databases." Confirm your selections.

  1. Configure Continuous Export:

Still within "Environment settings" for your subscription, navigate to "Continuous export." Click "Add data export." Select the data types you want to export (e.g., Security recommendations, Security alerts). Choose your export target, such as an Azure Event Hub or a Log Analytics Workspace, for integrating with SIEM solutions or custom dashboards. This is crucial for centralized logging and advanced analytics.

  1. Onboard Non-Azure Servers (optional, for hybrid environments):

From the Defender for Cloud blade, navigate to "Inventory." Click on "Add non-Azure servers." * Follow the instructions to deploy the Azure Arc agent to your on-premises or other cloud virtual machines. This enables Defender for Cloud to extend its protection and CSPM capabilities to these resources.

  1. Review and Prioritize Security Recommendations:

From the Defender for Cloud overview, select "Recommendations." Review the list of recommendations, which are prioritized by Secure Score impact. Filter by resource type, severity, or compliance control to focus on critical areas. For example, you might see recommendations like "Remediate vulnerabilities in your virtual machines" or "Enable Azure Disk Encryption on virtual machines."

  1. Create Custom Policies (using Azure Policy):

To enforce specific security requirements or automatically deploy agents, you can leverage Azure Policy integrated with Defender for Cloud. Navigate to the Azure portal, search for "Policy." Under "Authoring" select "Definitions" and search for policies related to Defender for Cloud. You can also create custom policies based on audit findings from Defender for Cloud. * Here’s an example PowerShell script to assign an Azure Policy definition for enabling Defender for Cloud for SQL databases at a subscription scope: ```powershell # Connect to Azure Connect-AzAccount

# Define policy assignment parameters $subscriptionId = (Get-AzContext).Subscription.Id $policyDefinitionName = "Deploy-SqlDbDefender" # Example built-in definition for Defender for SQL $policyAssignmentName = "Enable-DefenderForSQL-SubscriptionLevel" $resourceGroupName = "DefenderForCloudPolicyAssignments" # Optional: create a resource group for policy assignments if needed

# Get the policy definition $policyDefinition = Get-AzPolicyDefinition | Where-Object { $_.Properties.DisplayName -like "Microsoft Defender for SQL" } | Select-Object -First 1

if ($policyDefinition) { Write-Host "Policy definition found: $($policyDefinition.DisplayName)"

# Assign the policy New-AzPolicyAssignment -Scope "/subscriptions/$subscriptionId" -Name $policyAssignmentName -DisplayName "Enable Microsoft Defender for SQL on all SQL databases" -PolicyDefinition $policyDefinition -Parameter @{ "emailAdmins" = @{ "value" = "false" }; # Example parameter "emailSecurityContact" = @{ "value" = "false" }; "logAnalyticsWorkspaceResourceId" = @{ "value" = "" } # Only required if you want to send logs to a specific LAW } Write-Host "Policy assignment '$policyAssignmentName' created successfully for subscription '$subscriptionId'." } else { Write-Warning "Could not find a suitable policy definition for Microsoft Defender for SQL. Please verify built-in policy names." } ```

Example configuration

Defender for Cloud leverages Azure Policy under the hood. Here's a Bicep example to enable Defender for Storage on a specific Azure subscription. This ensures that blob storage, Azure Files, and Azure Data Lake Storage Gen2 are protected against malware and anomalous activities.

param subscriptionId string

resource defenderForStorage 'Microsoft.Security/autoProvisioningSettings@2017-08-01-preview' = {
  name: 'default'
  scope: subscription(subscriptionId)
  properties: {
    autoProvision: 'On'
    // Optional: You can specify more detailed settings here,
    // though 'autoProvision: On' usually enables the default Defender for Storage plan.
    // For specific pricing tiers or advanced settings, you might need to use
    // 'Microsoft.Security/pricing' resource or Azure Policy directly.
  }
}

resource defenderPricingForStorage 'Microsoft.Security/pricings@2022-03-01' = {
  name: 'StorageAccounts'
  scope: subscription(subscriptionId)
  properties: {
    pricingTier: 'Standard' // 'Standard' enables Defender for Storage
    subPlan: 'PerStorageAccount' // Or 'PerTransaction' depending on preference and cost model
  }
}

Common pitfalls

  • Enabling only free tier: Many organizations initially enable only the free CSPM features, missing out on critical CWP and advanced threat protection capabilities provided by paid Defender plans.
  • Ignoring Secure Score: Treating the Secure Score merely as a metric rather than an actionable guide for improvement leads to neglected security posture.
  • Lack of integration: Failing to integrate Defender for Cloud alerts and recommendations with existing SIEM (Security Information and Event Management) or SOAR (Security Orchestration, Automation, and Response) solutions, leading to siloed security operations.
  • Overlooking non-Azure resources: Restricting Defender for Cloud's scope to only Azure resources, missing the opportunity to secure hybrid and multi-cloud environments via Azure Arc integration.
  • Configuration drift: Not using Azure Policy or Infrastructure as Code (IaC) to consistently enforce security configurations, leading to unmanaged changes and vulnerabilities.
  • Ignoring compliance benchmarks: Not mapping Defender for Cloud's recommendations to specific regulatory compliance standards, which can make audits more difficult and identifying gaps challenging.

Best practices

  • Adopt a Zero Trust Mentality: Assume breach and continuously verify. Use Defender for Cloud to enforce least-privilege access, segment networks, and encrypt data at rest and in transit, aligning with Zero Trust principles.
  • Implement Cloud Adoption Framework (CAF) Security Baseline: Leverage the CAF's security guidance, which aligns strongly with Defender for Cloud's recommendations, to establish a robust security foundation from the outset.
  • Roll out Defender plans iteratively: Instead of enabling all plans at once, start with critical workloads (e.g., highly sensitive data, internet-facing applications) and expand coverage gradually.
  • Automate remediation: Use Azure Policy and Logic Apps to automate responses to security alerts and recommendations, reducing manual effort and improving response times.
  • Centralize security management: Integrate Defender for Cloud with Azure Monitor, Azure Sentinel (now Microsoft Sentinel), and your existing security tools to establish a unified security operations center (SOC).
  • Regularly review and refine policies: Conduct periodic reviews of Defender for Cloud settings, custom policies, and secure score improvements. Adapt configurations as your environment and threat landscape evolve.

Further reading

#Defender for Cloud#Azure

Related articles