Task "Stop VM" failing on "Authorized"

faithlyn patterson 0 Reputation points
2024-11-04T23:48:35.71+00:00

I set up a stop/deallocate task for some vm's to stop them on Saturdays and Sundays because I have a start vm task that starts them every day. The stop/deallocate is not working and giving me the following error:

"error": {    "code": "InvalidAuthenticationTokenTenant",    "message": "The access token is from the wrong issuer


I either need to add a "weekdays only" option in my start or be able to stop them on Saturdays and Sundays with the auto task "stop/deallocate".

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,989 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Akshay kumar Mandha 1,040 Reputation points Microsoft Vendor
    2024-11-06T04:45:59.2966667+00:00

    Hi faithlyn patterson,
    If you had chance reviewed my previous comment
    In the meantime, if you want to stop the VM on weekends, you need to use an Azure Automation account and create a Runbook. In that Runbook, paste your custom script, and you can schedule it based on your requirements. Please refer to the documentation below on how to set up an Automation account and Runbook."
    Quickstart: Create an Automation account using the Azure portal
    Tutorial: Create a PowerShell Workflow runbook in Automation

    Please let us know if you face any difficulties setting up the automation account and runbook, and we will assist you as needed.!

    If you found this information helpful, please click an accepting the answer and "Upvote" on my post for other community members referenceUser's image


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.