Open In App

Microsoft Azure – Find or Export Azure Compute Images using KQL

Improve
Improve
Like Article
Like
Save
Share
Report

Pre-requisite: Azure

In this article, we will show you how to find the azure compute images in your Azure environment using KQL (Kusto Query Language) resource graph queries. You can run all the below example queries by accessing Azure Resource Graph Explorer from Azure Portal. In order to read resources in Azure using KQL (Kusto Query Language) one should have at least read access on the select subscriptions or “Azure Resource Graph Data Reader” role in the management group.

Find or Export Azure Compute Images using KQL

Find all Compute Images in Azure

You can use the following KQL (Kusto Query Language) query to find the azure compute images in azure.

resources
| where type == "microsoft.compute/images"

this query will return all the azure images across all subscriptions.

all Compute Images in Azure

 

Find Azure Compute Images in Specific Subscription

If you want to filter for a specific or select subscription you can use the following KQL (Kusto Query Language) query.

resources
| where type == "microsoft.compute/images"
| where subscriptionId == "<subscriptionId>"
//replace <subscriptionId> with the actual subscriptionId

this query will return all the azure compute images from a specific subscription.

Compute Images in Specific Subscription

 

resources
| where type == "microsoft.compute/images"
| where subscriptionId == "<subscriptionId-01>" or 
| where subscriptionId == "<subscriptionId-02>" or 
| where subscriptionId == "<subscriptionId-03>"

Note: replace <subscriptionId-01>,  <subscriptionId-02>, <subscriptionId-03> with the actual subscriptionId of your selected subscriptions.

this query will return all the azure compute images from the selected given subscriptions.

Azure Compute Images in Specific Subscription

 


Last Updated : 31 Mar, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads