Describe the bug
Register-AzAutomationNodes fails if a DSC extension is already applied to target VMs because Azure Automation believes the VM is already being managed.
To Reproduce
Steps to reproduce the behavior:
Run Register-AzAutomationNodes for target machines that have a DSC extension applied
Expected behavior
Systems are successfully registered as Azure Automation Nodes.
Screenshots
Azure VM has a DSC Extension:
Azure Automation Node Registration fails in Powershell:
Registering the VM manually is also not possible as Azure Automation states that the VM is "Connected to another account"
Additional context
Register-AzAutomationNodes function should check for existing DSC extensions and remove them before attempting to register. May need to incorporate a prompt for users and/or a Force switch.
Describe the bug Register-AzAutomationNodes fails if a DSC extension is already applied to target VMs because Azure Automation believes the VM is already being managed.
To Reproduce Steps to reproduce the behavior:
Expected behavior Systems are successfully registered as Azure Automation Nodes.
Screenshots Azure VM has a DSC Extension:
Azure Automation Node Registration fails in Powershell:
Registering the VM manually is also not possible as Azure Automation states that the VM is "Connected to another account"
Additional context Register-AzAutomationNodes function should check for existing DSC extensions and remove them before attempting to register. May need to incorporate a prompt for users and/or a Force switch.