I'm trying to az rest put command to enable one extension on my vm but have some issues with my body and don't know what should I try next or change. My syntax is probably wrong
These are my lines
az rest --method put --uri https://management.azure.com/$resourceId/extensions/MDE.Windows?api-version=2015-06-15 --body {
"name": "MDE.Windows",
"id": "$resourceId/extensions/MDE.Windows",
"type": "Microsoft.Compute/virtualMachines/extensions",
"location": "westeurope",
"properties": {
"autoUpgradeMinorVersion": true,
"publisher": "Microsoft.Azure.AzureDefenderForServers",
"type": "MDE.Windows",
"typeHandlerVersion": "1.0",
"settings": {
"azureResourceId": "$resourceId",
"vNextEnabled": "true"
},
"protectedSettings": {
"defenderForEndpointOnboardingScript": "$defenderForEndpointOnboardingScript"
}
}
}
This then outputs following
ParserError: "name": "MDE.Windows", Unexpected token ':' in expression or statement.
i have tried --body with ' '
(Unsupported Media Type({"error":{"code":"UnsupportedMediaType","message":"The content media type '<null>' is not supported. Only 'application/json' is supported."}}))
and " "
but no luck.
(The command line is too long)
Any tips that I should try next or change in my code? Maybe try next something like this?
az rest --method put --uri https://management.azure.com/$resourceId/extensions/MDE.Windows?api-version=2015-06-15 --body @body.json
and just fyi: $defenderForEndpointOnboardingScrip is around 20 000 characters (one 'word').