Bird
Raised Fist0
Azurecloud~10 mins

Microsoft Defender for Cloud in Azure - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable Microsoft Defender for Cloud on a subscription.

Azure
az security pricing create --name [1] --tier 'Standard' --subscription 'my-subscription-id'
Drag options to blanks, or click blank then click option'
AStorageAccounts
BVirtualMachines
CSqlServers
DAppServices
Attempts:
3 left
💡 Hint
Common Mistakes
Using a resource type that is not supported for pricing tier setting.
Forgetting to specify the subscription ID.
2fill in blank
medium

Complete the code to list all security alerts in Microsoft Defender for Cloud.

Azure
az security alert list --subscription [1]
Drag options to blanks, or click blank then click option'
Amy-resource-group
Bmy-vm-name
Cmy-subscription-id
Dmy-storage-account
Attempts:
3 left
💡 Hint
Common Mistakes
Using a resource group name instead of subscription ID.
Using a resource name instead of subscription ID.
3fill in blank
hard

Fix the error in the command to disable Microsoft Defender for Cloud on Storage Accounts.

Azure
az security pricing create --name [1] --tier 'Free' --subscription 'sub-id-123'
Drag options to blanks, or click blank then click option'
AStorageAccounts
BVirtualMachines
CSqlServers
DAppServices
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong resource type name.
Setting tier to 'Standard' instead of 'Free' to disable.
4fill in blank
hard

Fill both blanks to create a custom security policy assignment with Microsoft Defender for Cloud.

Azure
az policy assignment create --name 'DefenderPolicy' --policy [1] --scope [2]
Drag options to blanks, or click blank then click option'
A/providers/Microsoft.Authorization/policyDefinitions/DeployIfNotExistsSecurityCenter
B/subscriptions/12345678-1234-1234-1234-123456789abc
C/subscriptions/87654321-4321-4321-4321-cba987654321
D/providers/Microsoft.Security/defenderSettings
Attempts:
3 left
💡 Hint
Common Mistakes
Using a resource provider path instead of a policy definition ID.
Using a resource provider path instead of a subscription scope.
5fill in blank
hard

Fill all three blanks to create a security automation that triggers on high severity alerts.

Azure
az security automation create --name 'HighSeverityAlertAutomation' --resource-group 'SecurityRG' --location 'eastus' --trigger [1] --condition [2] --action [3]
Drag options to blanks, or click blank then click option'
AMicrosoft.Security/alerts
Bseverity == 'High'
CMicrosoft.Security/automations/runPlaybook
DMicrosoft.Security/pricings
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect resource types for trigger or action.
Not filtering alerts by severity.

Practice

(1/5)
1. What is the main purpose of Microsoft Defender for Cloud?
easy
A. To manage user access and permissions in Azure
B. To increase the storage capacity of your Azure subscription
C. To find and help fix security issues in your cloud resources
D. To monitor the cost and billing of your Azure services

Solution

  1. Step 1: Understand the role of Microsoft Defender for Cloud

    It is designed to detect security vulnerabilities and threats in cloud resources.
  2. Step 2: Compare with other options

    Options A, B, and D describe other Azure services or features unrelated to Defender for Cloud's main function.
  3. Final Answer:

    To find and help fix security issues in your cloud resources -> Option C
  4. Quick Check:

    Defender for Cloud = Security issue detection [OK]
Hint: Defender for Cloud = cloud security scanner [OK]
Common Mistakes:
  • Confusing Defender for Cloud with cost management
  • Thinking it manages user permissions
  • Assuming it increases storage
2. Which pricing tier of Microsoft Defender for Cloud provides enhanced security features?
easy
A. Standard tier
B. Free tier
C. Basic tier
D. Premium tier

Solution

  1. Step 1: Recall pricing tiers for Defender for Cloud

    Microsoft Defender for Cloud offers Free and Standard tiers, where Standard has more features.
  2. Step 2: Identify the tier with enhanced features

    The Standard tier provides better protection than the Free tier; Basic and Premium are not valid tiers here.
  3. Final Answer:

    Standard tier -> Option A
  4. Quick Check:

    Standard tier = enhanced security [OK]
Hint: Standard tier > Free tier for security features [OK]
Common Mistakes:
  • Choosing Free tier as it sounds good
  • Selecting non-existent tiers like Basic or Premium
  • Confusing pricing tiers with Azure subscription levels
3. If you enable Microsoft Defender for Cloud Standard tier on your Azure subscription, what will happen?
medium
A. Your resources will be scanned for security vulnerabilities automatically
B. Your subscription cost will decrease immediately
C. All users will be blocked from accessing resources
D. Your storage capacity will double

Solution

  1. Step 1: Understand the effect of enabling Standard tier

    Enabling Standard tier activates automatic security scanning and threat detection on resources.
  2. Step 2: Evaluate other options

    Cost does not decrease (usually it increases), users are not blocked, and storage is unaffected.
  3. Final Answer:

    Your resources will be scanned for security vulnerabilities automatically -> Option A
  4. Quick Check:

    Standard tier enables automatic security scans [OK]
Hint: Standard tier = auto security scans on resources [OK]
Common Mistakes:
  • Expecting cost reduction after enabling Standard tier
  • Thinking it blocks all user access
  • Assuming it changes storage size
4. You tried to enable Microsoft Defender for Cloud Standard tier but received an error. Which of these is a likely cause?
medium
A. You set the storage account to read-only
B. You did not assign the correct pricing tier to the resource type
C. You disabled all network connectivity
D. You forgot to create a new Azure subscription

Solution

  1. Step 1: Identify common configuration errors for enabling Defender

    Enabling Defender requires setting the correct pricing tier per resource type.
  2. Step 2: Analyze other options

    Creating a new subscription is not required; network or storage settings unrelated to Defender tier cause different errors.
  3. Final Answer:

    You did not assign the correct pricing tier to the resource type -> Option B
  4. Quick Check:

    Correct pricing tier assignment needed [OK]
Hint: Set pricing tier correctly per resource type [OK]
Common Mistakes:
  • Assuming new subscription is needed
  • Blaming network or storage settings unrelated to Defender
  • Ignoring pricing tier configuration
5. You want to protect your Azure virtual machines and storage accounts with Microsoft Defender for Cloud. How should you configure it to get the best protection?
hard
A. Enable Standard tier for virtual machines and Free tier for storage accounts
B. Enable Standard tier only for storage accounts
C. Enable Free tier for both virtual machines and storage accounts
D. Enable Standard tier for both virtual machines and storage accounts

Solution

  1. Step 1: Understand tier benefits per resource type

    Standard tier provides better protection than Free tier for all resource types.
  2. Step 2: Apply best practice for multiple resource types

    To maximize security, enable Standard tier on both virtual machines and storage accounts.
  3. Final Answer:

    Enable Standard tier for both virtual machines and storage accounts -> Option D
  4. Quick Check:

    Standard tier on all resources = best protection [OK]
Hint: Use Standard tier on all resource types for best security [OK]
Common Mistakes:
  • Mixing tiers between resource types
  • Using Free tier for critical resources
  • Enabling Standard tier on only one resource type