azureazure-web-app-serviceazure-storageazure-application-insightsazure-dashboard

Azure Monitoring: How to create dashboard that show amount of storage left in a storage account?


How to create a dashboard that shows the amount of storage left in a storage account? I don't want to create alerts but I want to create a tile in the dashboard that either show one of the following:

  1. the amount of storage used by the storage account against its quota, hence some sort of percentage

  2. The amount of remaining storage space

  3. The amount of remaining storage space as a percentage


Solution

  • Thanks to @Norrin Rad. By referring to this, I have written a query for storage availability below:

        AzureMetrics 
        | where TimeGenerated > ago(timespan) //(eg:24 hrs)
        | where ResourceProvider == "MICROSOFT.STORAGE"
        | where _ResourceId contains "storage"
        | where MetricName =~ "availability"
        | project
            TimeGenerated,
            ResourceGroup,
            SubscriptionID,
            Resource, //(Here it is storage account)
            MetricName,
            Average,
            UnitName
    

    Go to Azure portal and follow these steps:

    Monitor->Logs->Write a query->save it
    

    After running the query, you will be able to see the logs as shown below: enter image description here

    After successfully executing the query, You will be able to pin it to your dashboards.

    enter image description here enter image description here

    Note: While saving the query make sure that you need to save content to azure storage account also by assigning user managed identity with the role "Storage Blob data contributor" (Eg: Blob storage)

    Reference link