Good morning Alexander_redacted_
In my experience and based on current best practices, using an Automation Account (or Logic Apps if you want a low-code alternative) is the most future-proof method.
Avoid: The “Start/Stop VMs v2” solution—as it is not under active development, its longevity is not guaranteed.
Authentication: Runbooks running in an Automation Account generally use either a Run As account or a Managed Identity to authenticate with Azure Resource Manager (ARM). If your API calls are failing with an error like:
{ "error": { "code": "AuthenticationFailed", "message": "Authentication failed. The 'Authorization' header is missing." }}
It means that your runbook (or task) isn’t injecting a valid token in the Authorization header. This usually happens if:
- You aren’t using a managed identity or “Run As” account.
- The code making the REST call isn’t properly requesting an access token from Azure AD.
Source links
1- https://learn.microsoft.com/en-us/azure/automation/
2- https://learn.microsoft.com/en-us/azure/virtual-machines/infrastructure-automation you can learn here and play with automatization
3- https://learn.microsoft.com/en-us/azure/logic-apps/create-automation-tasks-azure-resources
I hope this help you out
😊 If my answer helped you resolve your issue, please consider marking it as the correct answer. This helps others in the community find solutions more easily. Thanks!