Cannot install AADLoginForLinux via Azure Resource Manager Template
See original GitHub issueThe AAD Login for Linux is a great improvement for identity and access management of Linux servers in Azure. My team relies on Azure Resource Manager template to deploy applications and infrastructure. I would like to have these server deployments include adding the AAD Login for Linux extension. Unfortunately, I am encountering errors and cannot figure out how to resolve.
This the error returned from deployment
{ "id": "/subscriptions/.../resourceGroups/jenkins-devapps-rg/providers/Microsoft.Resources/deployments/initTemplate/operations/DE946D2D62CFD93C", "operationId": "DE946D2D62CFD93C", "properties": { "provisioningOperation": "Create", "provisioningState": "Failed", "timestamp": "2019-07-04T00:53:35.3932443Z", "duration": "PT2M53.1727507S", "trackingId": "cdbefe00-8b87-4af4-a4e9-ca0cbaa96cce", "statusCode": "Conflict", "statusMessage": { "status": "Failed", "error": { "code": "ResourceDeploymentFailure", "message": "The resource operation completed with terminal provisioning state 'Failed'.", "details": [ { "code": "VMExtensionProvisioningError", "message": "VM has reported a failure when processing extension 'AADLoginForLinux'. Error message: \"Failed to get status file [Errno 2] No such file or directory: '/var/lib/waagent/Microsoft.Azure.ActiveDirectory.LinuxSSH.AADLoginForLinux-1.0.8370001/status/0.status'\"." } ] } }, "targetResource": { "id": "/subscriptions/.../resourceGroups/jenkins-devapps-rg/providers/Microsoft.Compute/virtualMachines/jenkins-vm/extensions/AADLoginForLinux", "resourceType": "Microsoft.Compute/virtualMachines/extensions", "resourceName": "jenkins-vm/AADLoginForLinux" } }}
This snippet is taken from the template file being used in the deployment that results in the above posted error.
{ "apiVersion": "2019-03-01", "location": "[parameters('location')]", "name": "[concat(parameters('vmName'), '/AADLoginForLinux')]", "properties": { "autoUpgradeMinorVersion": true, "publisher": "Microsoft.Azure.ActiveDirectory.LinuxSSH", "protectedSettings": {}, "settings": {}, "type": "AADLoginForLinux", "typeHandlerVersion": "1.0" }, "type": "Microsoft.Compute/virtualMachines/extensions" }
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:9
Through some trial and error, I figured out how to specify the AADLinux extension for a VM defined in an ARM Template. It really came down to getting the right values for “publisher”, “type” and “typeHandlerVersion” right. For future reference, see below example:
I see a similar issue with scale sets and terraform, where the error is slightly different:
The extension is installed just fine via
az vmss extension set
, the problem only happens when doing via terraform.I noticed a discrepancy in the output when writing the settings file via terraform:
And via Azure CLI: