Using Azure Logic Apps for Listing Azure Resources

Using Azure Logic Apps, I demonstrate how to get Azure resource groups and their containing Azure resource and enter them into a SharePoint List. Although grouping of resource groups and their resources is possible in the Azure Portal, displaying the same information in a SharePoint list could be useful in a dashboard friendly scenario where it can be viewed by people who don’t have access to the Azure portal.

High Level Logic

  1. Trigger Logic by a daily Recurrence
  2. Get List of Azure resource groups
  3. Delete all existing list items of Azure resources in its SharePoint List
  4. Loop through each Azure resource group
    1. Loop through each Azure Resource Group
      1. Save Azure resource group and resource as a SharePoint list item

LogicAppRG1

As a result, I can see a daily refresh of Azure Resource Groups and its resources the following SharePoint List.
LogicAppRG2

Implementation Walk-through

  1. Trigger Logic App Daily
    LogicAppRG3
  2. Get List of Azure resource groupsLogicAppRG4
  3. Get list items from the SharePoint list containing Azure Resources. This is to clean up existing data to re-enter latest resources. LogicAppRG5
  4. Loop through each list item from previous step, retrieve the list item ID and delete from the SharePoint List by this item ID.LogicAppRG6
  5. For the retrieve list of Azure resource groups from step 2), loo through each resource group and retrieve the list of its Azure resources. This can be a web app, virtual machine, virtual network, etc. To get the Tag value to be used in a future step, I used the Data Operation Compose to hold the Tags value.
    LogicAppRG7
  6. In a nested loop, enumerate through each Azure resource and create a new list item into the SharePoint List. I populate property values retrieved into its respective SharePoint List properties.
    LogicAppRG8

Final Remarks

If a SharePoint list isn’t your target destination of this information, then one can extend this logic App to simply email this information, enter into a database or other content management system. From there you can use this data and for further tracking, analysis, manipulation and governance as you see fit.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s