Calling Azure Resource APIs from Power Automate Using Graph Explorer

In today's fast-paced technological landscape, cloud integration and have ascended as twin pillars of modern business efficiency. Microsoft's Azure and Power Automate are two titans in this arena, each offering a unique set of capabilities. But what if we could marry the vast cloud resources of Azure with the intuitive workflow of Power Automate? In this article, we'll embark on a digital journey to explore how you can seamlessly call Azure Resource APIs from Power Automate, unlocking new vistas of potential for your business processes. Whether you're an Azure aficionado, a Power Automate pro, or someone just stepping into the cloud, strap in and let's dive deep into this integration!
High Level Overview
We recently created an application that uses PowerApps, and Azure to build Resources like . This is explained in my previous article Automating Azure VM Deployment. One of the issues we came across was populating the SharePoint with the correct Parameter Values that we can query from PowerApps and Power Automate. We wanted the Virtual and Subnet Values so that users can choose which Virtual their Azure Resources will be laced in.
I am a massive fan of using Azure Resource Graph and I knew I could get the values using the below query.
| where type == ‘microsoft./virtualnetworks'
| extend vnet_name = name
| mv-expand subnets = properties.subnets
| project vnet_name,, subscriptionId
The results would look like this:
But how can I use the above information in my PowerAutomate?
Luckily there are some awesome Azure Resource Graph APIs I can call as well as passing in a query like above!
You can read more at Azure Resource Graph REST API Documentation
1. An Azure App Service Principal with Permissions to the Azure Resources you need to access (see Quickstart Register an App)
2. Access to a Power Automate Environment
Step 1: Create a new Flow with the HTTP Request Action
Step 2: Fill in the details 
Method: POST
Body: (Replace the #TODO below with your Groups)
“managementGroups”: [
“query”: “resources | where type == ‘' | extend vnet_name = name | mv-expand subnets = properties.subnets | project vnet_name,, subscriptionId”
Step 3: Click “Show Advanced options” and complete the below fields. 
Step 4: Run a Test
As you can see, we now have the JSON Response that contains the data we want. We can now insert these values into SharePoint or re-use them somewhere else. Have fun!
The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts or Dashboards are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts or  Dashboards be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.


This article was originally published by Microsoft's Core Infrastructure and Security Blog. You can find the original article here.