Microsoft Azure Documentation

Monitor Azure Blob Storage

This article explains how to monitor your Azure Blob Storage account to ensure your storage is available and performing optimally. Monitoring is crucial for understanding performance, diagnosing issues, and planning capacity.

Key Monitoring Tools and Services

Azure provides several integrated services to help you monitor Blob Storage:

Metrics for Blob Storage

Azure Monitor collects several metrics for Blob Storage. Key metrics include:

Metric Name Description Unit
Transactions The total number of storage transactions. Count
Ingress The total number of bytes received by the storage account. Bytes
Egress The total number of bytes sent from the storage account. Bytes
Availability The percentage of successful requests to the storage service. Percent
Latency (Average) The average time taken for a request to be processed. Milliseconds

Viewing Metrics in Azure Portal

You can view these metrics directly in the Azure portal:

  1. Navigate to your storage account in the Azure portal.
  2. In the left-hand menu, under Monitoring, select Metrics.
  3. Choose the metric you want to analyze from the dropdown menu.
  4. Configure the time range, aggregation, and splitting options as needed.
Note: Storage Analytics metrics are stored for 30 days.

Logs for Blob Storage

Azure Storage Analytics can log details about successful and failed requests to your storage service. These logs are invaluable for troubleshooting and auditing.

You can enable logging for Blob Storage by configuring the diagnostic settings in Azure Monitor:

  1. Navigate to your storage account.
  2. Under Monitoring, select Diagnostic settings.
  3. Click Add diagnostic setting.
  4. Select the log categories you want to collect (e.g., StorageRead, StorageWrite, StorageDelete).
  5. Choose where to send the logs:
    • Send to Log Analytics workspace
    • Archive to a storage account
    • Stream to an event hub
  6. Save the settings.

Example Log Query (KQL)

Once logs are sent to a Log Analytics workspace, you can query them using Kusto Query Language (KQL).

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.STORAGE" and Category == "StorageRead"
| summarize count() by CallerIpAddress, OperationName
| order by count_ desc

Setting Up Alerts

Proactive monitoring is essential. You can configure alerts in Azure Monitor based on metrics or log events:

To create an alert:

  1. Navigate to Azure Monitor in the Azure portal.
  2. Select Alerts, then click Create > Alert rule.
  3. Define the scope (your storage account).
  4. Configure the condition (metric or log query).
  5. Set the action group to be notified (e.g., email, SMS, webhook).
  6. Define the alert details.
Tip: Consider setting up alerts for increased error rates (e.g., 4xx, 5xx errors) and significant deviations in latency or transaction counts.

Using Azure Advisor

Azure Advisor analyzes your resource configurations and usage patterns to provide tailored recommendations. For Blob Storage, it might suggest:

Access Azure Advisor from the Azure portal and review the recommendations under the "Storage" category.

Best Practices for Monitoring

By effectively monitoring your Azure Blob Storage, you can maintain high availability, optimize performance, and ensure efficient operation of your storage solutions.