Microsoft Azure – Export the List of Azure Storage Services using KQL
In this article, we will show you how to export the information of Azure Storage Services by using KQL (Kusto Query Language) resource graph query to retrieve within a subscription in simple and easy steps. We will be using Azure native service called Azure Resource Graph Explorer to retrieve the information. To retrieve the information one should require RBAC read access on the select or multiple Azure subscriptions.
Steps to Export the List of Azure Storage Services
Step 1: Log in to Azure Portal
Step 2: Open or Access the Azure Resource Graph Explorer
Step 3: To get the Azure Storage Services >> use the following KQL (Kusto Query Language) query to retrieve information about Azure Storage Services in a subscription. (Refer to Sample Output)
resources | where type in~("Microsoft.Storage/storageAccounts", "Microsoft.Storage/storageAccounts/blobServices", "Microsoft.Storage/storageAccounts/fileServices", "Microsoft.Storage/storageAccounts/tableServices", "Microsoft.Storage/storageAccounts/queueServices") | project name, type, subscriptionId
This query will return the name, type, and subscription ID of the Azure Storage Services.
Note: In the above query you can modify it to get the information you need by adding or removing columns and filters.
Step 4: Now click on Download as CSV to export the information to a CSV file.
Bonus Examples: To get the count or to verify the count use the following KQL query.
resources | where type has "microsoft.storage" | extend Type = tostring(type) | parse Type with ResourceType"/"ServiceName | summarize Resource_Count=count() by ResourceType, ServiceName
This query will return the service name and total count of resources.
Please Login to comment...