Remediation
From Azure Portal
- From Azure Home, select the Portal Menu.
- Select
Microsoft Defender for Cloud. - Under
Management, selectEnvironment Settings. - Select a subscription.
- Click on
Settings & monitoring. - Set the
StatusofLog Analytics agenttoOn. - Select a Workspace.
- Click
Apply. - Click
Continue.
Repeat the above for any additional subscriptions.
From Azure CLI
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/{{subscription-id}}/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/{{subscription-id}}/providers/Microsoft.Security/autoProvisioningSettings/default",
"name": "default",
"type": "Microsoft.Security/autoProvisioningSettings",
"properties": {
"autoProvision": "On"
}
}