Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Trying to check the queue to deallocate VMs to reduce cost

(1) ShareShare
ReportReport
Posted on by 119

Hi everyone,

I hope you're all doing well. I'm currently developing a flow in Power Automate to manage virtual machines (VMs) in a machine group based on the presence of items in a queue. The intended functionality of the flow is as follows:

  1. Check Queue: Verify if there are any items in the queue of a machine group.
  2. Power Management:
    • If there are no items in the queue: Turn off all VMs in the machine group.
    • If there are items in the queue: Turn on the VMs in the machine group.

During the development of this flow, I'm encountering an "Authentication failed" error when trying to authenticate and retrieve data from the Power Automate API. Here’s a brief outline of the steps and configurations I have implemented:

  1. Azure Automation: Created a runbook to generate an authentication token using client credentials (tenant ID, client ID, and client secret). The runbook successfully generates a token.
  2. Power Automate Flow: Use the generated token to make an HTTP GET request to the Power Automate API to check the queue status. I encounter the "Authentication failed" error during this HTTP request.

I have ensured that the client credentials are correct and have sufficient permissions. 

Maybe there is another way to do this on a easier way, I just wanted to reduce costs of my VMs that sometimes, just stay "idle" for a while.

 

Could anyone help me resolve this issue? Any guidance or suggestions to troubleshoot this authentication error would be greatly appreciated.

Thanks for your support!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492