Azure / azure-quickstart-templates

Azure Quickstart Templates
https://aka.ms/azqst
MIT License
13.95k stars 16.08k forks source link

Issue with join domain using ARM templates #6394

Open shubhamgarg150391 opened 5 years ago

shubhamgarg150391 commented 5 years ago

I am not able to join my VM to domain using ARM Templates. However , it is working fine if i do it manually.

Below is the error. Can someone please help on this.

At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.

Details: Conflict: { "status": "Failed", "error": { "code": "ResourceDeploymentFailure", "message": "The resource operation completed with terminal provisioning state 'Failed'.", "details": [ { "code": "DeploymentFailed", "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.", "details": [ { "code": "Conflict", "message": "{\r\n \"status\": \"Failed\",\r\n \"error\": {\r\n \"code\": \"ResourceDeploymentFailure\",\r\n \"message\": \"The resource operation completed with terminal provisioning state 'Failed'.\",\r\n \"details\": [\r\n {\r\n \"code\": \"VMExtensionProvisioningError\",\r\n \"message\": \"VM has reported a failure when processing extension 'joindomain'. Error message: \\"Exception(s) occured while joining Domain 'team.local'\\".\"\r\n }\r\n ]\r\n }\r\n}" }, { "code": "Conflict", "message": "{\r\n \"status\": \"Failed\",\r\n \"error\": {\r\n \"code\": \"ResourceDeploymentFailure\",\r\n \"message\": \"The resource operation completed with terminal provisioning state 'Failed'.\",\r\n \"details\": [\r\n {\r\n \"code\": \"VMExtensionProvisioningError\",\r\n \"message\": \"VM has reported a failure when processing extension 'joindomain'. Error message: \\"Exception(s) occured while joining Domain 'team.local'\\".\"\r\n }\r\n ]\r\n }\r\n}" } ] } ] } } undefined Task failed while creating or updating the template deployment.

kaushikgayal commented 4 years ago

I am now using Azure CLI script to join domain as an alternative:

az vm extension set -n JsonADDomainExtension --publisher Microsoft.Compute --version 1.3 --vm-name $(vmname) --resource-group $(resourcegroupname) --settings '{"Name":"$(domainName)", "OUPath":"$(OUPath)", "User":"$(aduser)", "Restart":"true", "Options":"3"}' --protected-settings '{"Password":"$(adpass)"}'