---
title: Storage Management for Microsoft Azure Blob Storage
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Infrastructure > Storage Management > Storage Management for Microsoft
  Azure Blob Storage
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Storage Management for Microsoft Azure Blob Storage

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

{% callout %}
# Important note for users on the following Datadog sites: app.datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, app.datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com

{% callout %}
##### Join the Preview!

Storage Management is in Preview. Request access to start monitoring your object storage.

[Request Access](https://www.datadoghq.com/product-preview/storage-monitoring/)
{% /callout %}

{% /callout %}

## Setup{% #setup %}

{% alert level="info" %}
Azure Marketplace integration is not supported with Storage Management. You must use an [App Registration](https://docs.datadoghq.com/integrations/azure.md) to connect Azure to Datadog.
{% /alert %}

{% tab title="Azure CLI" %}

1. Go to **Storage Management** > **Azure Blob Storage** > [**Enable buckets**](https://app.datadoghq.com/storage-management?mConfigure=true&mView=azure).
1. Select the storage accounts you want to enable for Storage Management.
1. Run the CLI commands in your [Azure Cloud Shell](https://shell.azure.com) generated at the bottom of the table. Before running the script, set your shell environment to Bash.
1. After running the script, click **Confirm** and wait 24-48 hours for Storage Management metrics to become available.

{% /tab %}

{% tab title="Azure Portal" %}
For each storage account you want to monitor, follow these steps:

{% collapsible-section #azure-portal-step1 %}
#### 1. Create a blob inventory policy


1. In the Azure portal, navigate to your Storage Account.
1. Go to **Data management** > **Blob inventory**.
1. Click **Add**.
1. Configure the policy:
   - Name: **datadog-storage-monitoring**
   - Destination container:
     - Click **Create new**, and enter the name `datadog-storage-monitoring`.
   - Object type to inventory: **Blob**
   - Schedule: **Daily**
   - Blob types: Select **Block blobs**, **Append blobs**, and **Page blobs**.
   - Subtypes: Select **Include blob versions**
   - Schema fields: Select All, or ensure that at least the following are selected:
     - **Name**
     - **Access tier**
     - **Last modified**
     - **Content length**
     - **Server encrypted**
     - **Current version status**
     - **Version ID**
   - Exclude prefix: datadog-storage-monitoring
1. Click **Add**.

{% /collapsible-section %}

{% collapsible-section #azure-portal-step2 %}
#### Add the role assignment

1. In the Azure portal, navigate to your Storage Account.
1. Go to **Data storage** > **Containers**.
1. Click on the **datadog-storage-monitoring** container.
1. Click on **Access control (IAM)** in the left-hand menu.
1. Click **Add** > **Add role assignment**.
1. Fill out the role assignment:
   - Role: Select **Storage Blob Data Reader**. Click **Next**.
   - Assign access to: **User, group, or service principal**.
   - Members: Click **+ Select members** and search for your App Registration by its name and select it.
   - **Note**: This should be an App Registration set up in the Datadog Azure integration. Keep in mind the Client ID for later.
1. Click **Review + assign**.

{% /collapsible-section %}

### Enable storage accounts in Datadog{% #enable-storage-accounts-in-datadog %}

After you configure the blob inventory policy and role assignment, enable each storage account in Datadog. Use either the Datadog UI or the API.

#### Datadog UI{% #datadog-ui %}

Go to **Datadog** > **Storage Management** > **Azure Blob Storage** > [**Enable buckets**](https://app.datadoghq.com/storage-management?mConfigure=true&mView=azure). Select the storage accounts you enabled inventory on and click **Confirm**.

#### API{% #api %}

Register each storage account with Storage Management by calling the [Enable Storage Management for a bucket](https://docs.datadoghq.com/api/latest/storage-management.md#enable-storage-management-for-a-bucket) endpoint. The App Registration must be connected to Datadog through the [Azure integration](https://docs.datadoghq.com/integrations/azure.md#setup).

Before running the following `curl` command, set these environment variables:

- `DD_SITE`: Your [Datadog site](https://docs.datadoghq.com/getting_started/site.md), <YOUR_DATADOG_SITE>. To show the value for a different site, use the site selector on this page.
- `DD_API_KEY`: A Datadog [API key](https://docs.datadoghq.com/account_management/api-app-keys.md#api-keys).
- `DD_APP_KEY`: A Datadog [application key](https://docs.datadoghq.com/account_management/api-app-keys.md#application-keys) with the **Cloud Inventory Write** [permission](https://docs.datadoghq.com/account_management/rbac/permissions.md).

```bash
curl -X PUT "https://api.${DD_SITE}/api/v2/cloudinventoryservice/syncconfigs" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "DD-API-KEY: ${DD_API_KEY}" \
  -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
  -d '{
    "data": {
      "id": "azure",
      "type": "cloud_provider",
      "attributes": {
        "azure": {
          "client_id": "<CLIENT_ID>",
          "tenant_id": "<TENANT_ID>",
          "subscription_id": "<SUBSCRIPTION_ID>",
          "resource_group": "<RESOURCE_GROUP>",
          "storage_account": "<STORAGE_ACCOUNT>",
          "container": "<INVENTORY_CONTAINER>"
        }
      }
    }
  }'
```

To use the preceding `curl` command:

- Replace `<CLIENT_ID>` with the **Application (client) ID** of the App Registration that has the **Storage Blob Data Reader** role on the inventory container.
- Replace `<TENANT_ID>` with the **Directory (tenant) ID** of that App Registration.
- Replace `<SUBSCRIPTION_ID>` with the ID of the Azure subscription that contains the storage account.
- Replace `<RESOURCE_GROUP>` with the name of the resource group that contains the storage account.
- Replace `<STORAGE_ACCOUNT>` with the name of the storage account the blob inventory policy is configured on.
- Replace `<INVENTORY_CONTAINER>` with the name of the destination container for the blob inventory reports, for example, `datadog-storage-monitoring`. Datadog reads inventory reports from the entire container.

All fields are required. Make one request per storage account. A `200` response confirms that Storage Management is enabled for the storage account.
{% /tab %}

### Validation{% #validation %}

To verify your setup:

1. Wait for the first inventory report to generate. Storage Management metrics can take 24-48 hours to become available.
1. Navigate to **Infrastructure** > [**Storage Management**](https://app.datadoghq.com/storage-management), select **Monitored buckets**, and confirm that the storage accounts you configured appear in the explorer list.

## Further reading{% #further-reading %}

Additional helpful documentation, links, and articles:

- [Optimize and troubleshoot cloud storage at scale with Storage Monitoring](https://www.datadoghq.com/blog/datadog-storage-monitoring/)
- [Reduce cloud storage costs and improve operational efficiency with Datadog Storage Monitoring](https://www.datadoghq.com/blog/storage-monitoring-recommendations/)
