azsec / scaf-azure-arm-templates

Collection of Azure Resource Manager templates to deploy Azure security baseline services.
https://azsec.azurewebsites.net/
Apache License 2.0
10 stars 19 forks source link

Extension fails to install on Windows VM #6

Open ruslangalasun opened 2 years ago

ruslangalasun commented 2 years ago

MDE extension deployment is returning the error below. I tried the deployment using Azure DevOps first and then did the manual ARM deployment through Azure Portal.

Status Message: VM has reported a failure when processing extension 'MDE.Windows'. Error message: "Failed to configure Microsoft Defender for Endpoint: Protected Setting defenderForEndpointOnboardingScript does not exist, please use mdeOnboardings API to retreive it (https://docs.microsoft.com/en-us/rest/api/securitycenter)"

ruslangalasun commented 2 years ago

To add some context, this is the code I'm using in my ARM template:

{ "type": "Microsoft.Compute/virtualMachines/extensions", "apiVersion": "2021-03-01", "location": "[parameters('location')]", "name": "[concat(parameters('vmName'),'/MDE.Windows')]", "properties": { "autoUpgradeMinorVersion": true, "publisher": "Microsoft.Azure.AzureDefenderForServers", "type": "MDE.Windows", "typeHandlerVersion": "1.0", "settings": { "azureResourceId": "[resourceId('Microsoft.Compute/virtualMachines',parameters('vmName'))]", "defenderForServersWorkspaceId": "[parameters('WorkspaceId')]", "forceReOnboarding": false }, "protectedSettings": {} } }

ruslangalasun commented 2 years ago

Hopefully, someone can look into this issue soon. Here are some additional troubleshooting details that I did. When I looked at one of the older VMs that we have I saw the following files for the Extension:

image

In this case, the extension was provisioned successfully and we didn’t see any issues.

Here is a screenshot from a new VM where the extension is failing: image

You can see that WindowsDefenderATPOnboardingScript file is missing, which is exactly what the error message is complaining about: