Azure Storage Usage Availability report

Copper Contributor

Hi,

I am trying to create a report for Azure File storage "usage and availability" report for monitoring. I have activated the diagnostics but How can I retrieve this report using KQL.

 

Thanks in Advance for the help

Regards

Arumai

4 Replies

@Arumai 

 

Is this for Storage Accounts and File Shares (Azure File Storage)

e.g

Clive_Watson_0-1712680191100.png

If so, there are built-in Workbooks already, which use Azure Metrics (rather than Diagnostics) which you can adapt or use 

Creating a "usage and availability" report for Azure File Storage using Kusto Query Language (KQL) involves several steps, starting from activating diagnostics to writing and executing the query in Azure Monitor or Azure Log Analytics.

1) Enable Diagnostics Settings: It seems you've already activated diagnostics for Azure File Storage. Ensure it's configured to send data to Azure Monitor Logs (Log Analytics workspace).

2) Access Log Analytics: Navigate to your Azure Log Analytics workspace where your storage account diagnostics data is sent.

3) Write Your KQL Query: To retrieve a usage and availability report, you'll need to query the right tables and fields. Azure File Storage diagnostics logs can include metrics such as TotalRequests, TotalIngress, TotalEgress, SuccessE2ELatency, and ServerLatency, among others.

Here's a basic structure of how you might start your KQL query:

StorageFileLogs
| where TimeGenerated > ago(30d) // Adjust the timeframe as needed
| summarize TotalRequests = sum(TotalRequests), TotalIngress = sum(TotalIngress), TotalEgress = sum(TotalEgress) by bin(TimeGenerated, 1d), AccountName, ShareName
| order by TimeGenerated desc

This query is an example that aggregates total requests, ingress, and egress over the last 30 days, grouped by day, account name, and share name. You might need to adjust the fields and aggregation based on what specific metrics are relevant for your "usage and availability" report.

1) Run the Query and Analyze: Execute the query in the Log Analytics workspace. You can analyze the results directly there or export them to a tool like Power BI for more advanced visualizations.

2) Refine Your Query: Depending on your needs, you might want to refine the query further. For example, you could focus on specific time windows, filter for particular file shares, or look into other metrics like availability, latency, or error rates.

3) Automation: If you need this report regularly, consider automating the process. Azure offers options to automate the execution of KQL queries and the delivery of reports, such as using Azure Logic Apps or Automation Runbooks.

Remember, the exact query will depend on the specific metrics and dimensions that are relevant to your usage and availability needs. You might also want to consult the Azure documentation for the latest schema details of StorageFileLogs or any other relevant tables in your Log Analytics workspace.

@Kugan Nadaraja 

Hi Kugan,
Thanks for the very detailed explanation. In my "StorageFileLogs" the following fields TotalRequests, TotalIngress, TotalEgress, are not available. when I try to run the query these fields highlighted in RED meaning these are not available. I am not sure whether I am missing some log collection.

Arumai_0-1712740228853.png

 

Hi Clive,
Thanks for the reply and I have reviewed it. Yes, it is able to give capacity info. This is useful.
Regards
Arumai