Azure / Azure-Lighthouse-samples

Provide samples for understanding managed service solutions
MIT License
295 stars 296 forks source link

Update deployLighthouseIfNotExistManagementGroup.json #102

Closed aparnabhat-gh closed 3 years ago

aparnabhat-gh commented 3 years ago

Was getting this error when remediating existing subscriptions:-

Details

Code

InvalidTemplate

Message

Deployment template validation failed: 'The template resource 'Microsoft.ManagedServices/registrationAssignments/8739504b-8d54-52a6-af54-57d19b613bf8' cannot reference itself. Please see https://aka.ms/arm-template-expressions/#reference for usage details.'.

Added strings as below to generate 2 separate guid for RegistrationName and Assignment Name

                      "managedByRegistrationName": "[[guid('RegistrationName',parameters('managedByName'))]",
                      "managedByAssignmentName": "[[guid('AssignmentName',parameters('managedByName'))]"
serenaz commented 3 years ago

Hi! Thanks for the contribution. I think this fix (https://github.com/Azure/Azure-Lighthouse-samples/commit/5808b6145c253db659015079bd96173e9853b0c2) should solve the issue, but please let us know if not.