Automating Domain Unjoin When Deleting VMSS Instance

Santosh Patil 5 Reputation points
2024-08-04T13:12:10.16+00:00

Hello,

I am trying to create an automation that unjoins a domain when an alert triggers for VM deletion. I have set up a single VMSS, an alert, two action groups (for email and automation), and an Azure automation account runbook.

When attempting to destroy an instance in VMSS, I receive emails from the email action group, but there is no indication of an automation action group. Trying the "Test" button in the Automation action group results in an "HTTP 401: The Automation Runbook returned a 'Unauthorized' error." message. I'm not sure which permissions I need to set up and where. I have tried various permissions, but none of them seemed to work.

Thank you, Santosh Patil

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,257 questions
Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
408 questions
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.