Back to controls

[Deprecated] Ensure Auto provisioning of 'Log Analytics agent for Azure VMs' is Set to 'On'

Enable automatic provisioning of the monitoring agent to collect security data.

Category

Controls

Low

Applies to

General guidance

Coverage

null controls, 0 queries

Asset types

Not specified

Overview

Enable automatic provisioning of the monitoring agent to collect security data.

DEPRECATION PLANNED: The Log Analytics Agent is slated for deprecation in August 2024. The Microsoft Defender for Endpoint agent, in tandem with new agentless capabilities, will provide replacement functionality. More detail is available here: https://techcommunity.microsoft.com/t5/microsoft-defender-for-cloud/microsoft-defender-for-cloud-strategy-and-plan-towards-log/ba-p/3883341.

Rationale

When Log Analytics agent for Azure VMs is turned on, Microsoft Defender for Cloud provisions the Microsoft Monitoring Agent on all existing supported Azure virtual machines and any new ones created. The Microsoft Monitoring Agent scans for various security-related configurations and events, such as system updates, OS vulnerabilities, and endpoint protection, and provides alerts.

Default Value

By default, Automatic provisioning of monitoring agent is set to On.

Remediation guidance

From Azure Console

  1. Go to Microsoft Defender for Cloud
  2. Under Management, select Environment Settings
  3. Select a subscription
  4. Select Settings & monitoring
  5. Set Log Analytics agent/Azure Monitor Agent to On

Repeat the above for any additional subscriptions.

Using Azure Command Line Interface

Use the below command to set Automatic provisioning of monitoring agent to On.

az account get-access-token --query "{subscription:subscription,accessToken:accessToken}" --out tsv | xargs -L1 bash -c 'curl -X PUT -H "Authorization: Bearer $1" -H "Content-Type: application/json" https://management.azure.com/subscriptions/subscriptionID/providers/Microsoft.Security/autoProvisioningSettings/default?api-version=2017-08-01-preview -d@"input.json"'

Where input.json contains the Request body json data as mentioned below.

{
    "id": "/subscriptions/<subscriptionID>/providers/Microsoft.Security/autoProvisioningSettings/default",
    "name": "default",
    "type": "Microsoft.Security/autoProvisioningSettings",
    "properties": {
        "autoProvision": "On"
    }
}

Additional Information

  • Excluding any of the entries in input.json may disable the specific setting by default
  • Microsoft has recently changed APIs to get and Update Automatic Provisioning Settings. This recommendation is updated accordingly.

References

  1. https://learn.microsoft.com/en-us/azure/security-center/security-center-data-security
  2. https://learn.microsoft.com/en-us/azure/security-center/security-center-enable-data-collection
  3. https://msdn.microsoft.com/en-us/library/mt704062.aspx
  4. https://msdn.microsoft.com/en-us/library/mt704063.aspx
  5. https://learn.microsoft.com/en-us/rest/api/securitycenter/autoprovisioningsettings/list
  6. https://learn.microsoft.com/en-us/rest/api/securitycenter/autoprovisioningsettings/create
  7. https://learn.microsoft.com/en-us/security/benchmark/azure/security-controls-v3-logging-threat-detection#lt-5-centralize-security-log-management-and-analysis
  8. https://learn.microsoft.com/en-us/security/benchmark/azure/security-controls-v3-logging-threat-detection#lt-3-enable-logging-for-security-investigation
  9. https://learn.microsoft.com/en-us/security/benchmark/azure/security-controls-v3-incident-response#ir-2-preparation--setup-incident-notification

Multiple Remediation Paths

Azure

SERVICE-WIDE (RECOMMENDED when many resources are affected): Assign Azure Policy initiatives at management group/subscription scope and trigger remediation tasks.

az policy assignment create --name <assignment-name> --scope /subscriptions/<subscription-id> --policy-set-definition <initiative-id>
az policy remediation create --name <remediation-name> --policy-assignment <assignment-id>

ASSET-LEVEL: Apply the resource-specific remediation steps above to the listed non-compliant resources.

PREVENTIVE: Embed Azure Policy checks into landing zones and IaC workflows to block or auto-remediate drift.

References for Service-Wide Patterns

  • Azure Policy overview: https://learn.microsoft.com/en-us/azure/governance/policy/overview
  • Azure Policy remediation: https://learn.microsoft.com/en-us/azure/governance/policy/how-to/remediate-resources
  • Azure Policy initiative structure: https://learn.microsoft.com/en-us/azure/governance/policy/concepts/initiative-definition-structure

Operational Rollout Workflow

Use this sequence to reduce risk and avoid repeated drift.

1. Contain at Service-Wide Scope First (Recommended)

  • Azure: assign policy initiatives at management group/subscription scope and run remediation tasks.
az policy assignment create --name <assignment-name> --scope /subscriptions/<subscription-id> --policy-set-definition <initiative-id>
az policy remediation create --name <remediation-name> --policy-assignment <assignment-id>

2. Remediate Existing Affected Assets

  • Execute the control-specific Console/CLI steps documented above for each flagged resource.
  • Prioritize internet-exposed and production assets first.

3. Validate and Prevent Recurrence

  • Re-scan after each remediation batch.
  • Track exceptions with owner and expiry date.
  • Add preventive checks in IaC/CI pipelines.

Query logic

These are the stored checks tied to this control.

No stored query bodies are attached to this entry.

Cyscale Logo
Cyscale is an agentless cloud-native application protection platform (CNAPP) that automates the contextual analysis of cloud misconfigurations, vulnerabilities, access, and data, to provide an accurate and actionable assessment of risk.

Stay connected

Receive new blog posts and product updates from Cyscale

By clicking Subscribe, I agree to Cyscale’s Privacy Policy


© 2026 Cyscale Limited

LinkedIn icon
Twitter icon
Facebook icon
crunch base icon
angel icon