> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mixpeek.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure Blob Storage

> Connect Mixpeek to your Azure Blob Storage containers to ingest and process your data.

> [!NOTE]
>
> This guide explains how to connect your Azure Blob Storage containers to Mixpeek, enabling automated data ingestion and processing.

## Prerequisites

* An active Azure subscription.
* A Storage Account with Blob Storage containers containing the data you want Mixpeek to process.
* Permissions to create and manage storage account access keys or managed identities.

## Configuration Steps

Connecting Mixpeek to Azure Blob Storage requires granting Mixpeek read access to your containers. We recommend using a managed identity or storage account access key for authentication.

**1. Configure Storage Account Access**

First, you need to configure access to your Azure Blob Storage containers. Choose one of the following methods:

**Option A: Storage Account Access Key (Simpler Setup)**

1. Navigate to your Storage Account in the Azure Portal.
2. Go to **Access keys** under **Security + networking**.
3. Copy either the **key1** or **key2** value. You'll need this to configure the connection in Mixpeek.
4. Store the key securely.

**Option B: Managed Identity (Recommended for Security)**

1. Navigate to your Storage Account in the Azure Portal.
2. Go to **Access Control (IAM)**.
3. Click **Add** > **Add role assignment**.
4. Select the **Storage Blob Data Reader** role.
5. Assign access to the managed identity that Mixpeek will use.

**2. Configure Container Access**

Ensure your container has the appropriate access level:

1. Navigate to your container in the Azure Portal.
2. Go to **Change access level**.
3. Set the access level to either:
   * **Private (no anonymous access)** - Use this if you're using access keys or managed identity
   * **Blob (anonymous read access for blobs only)** - Use this if you want to allow public read access
4. Click **OK** to save the changes.

**3. Add Azure Blob Storage Connection in Mixpeek**

In Studio, go to **Settings > Connections > New Connection** and pick **Azure Blob Storage**.

1. Choose your authentication method, account key or managed identity.
2. Enter the **storage account name** and the **container** name.
3. Optionally set a **prefix** to scope the sync to one folder.
4. Save. Mixpeek tests the credentials before storing them.

To create the same connection over the API, `POST /v1/organizations/connections`. The
`credentials.type` field selects the method:

```bash Account key theme={null}
curl -X POST https://api.mixpeek.com/v1/organizations/connections \
  -H "Authorization: Bearer mxp_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "azure-media",
    "provider_type": "azure_blob",
    "provider_config": {
      "provider_type": "azure_blob",
      "account_name": "YOUR_STORAGE_ACCOUNT",
      "container": "YOUR_CONTAINER",
      "prefix": "media/",
      "credentials": {
        "type": "account_key",
        "account_name": "YOUR_STORAGE_ACCOUNT",
        "account_key": "YOUR_ACCESS_KEY"
      }
    },
    "test_before_save": true
  }'
```

```bash Managed identity theme={null}
curl -X POST https://api.mixpeek.com/v1/organizations/connections \
  -H "Authorization: Bearer mxp_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "azure-media",
    "provider_type": "azure_blob",
    "provider_config": {
      "provider_type": "azure_blob",
      "account_name": "YOUR_STORAGE_ACCOUNT",
      "container": "YOUR_CONTAINER",
      "credentials": {
        "type": "managed_identity",
        "client_id": "OPTIONAL_USER_ASSIGNED_IDENTITY_CLIENT_ID"
      }
    },
    "test_before_save": true
  }'
```

```python Python theme={null}
import requests

requests.post(
    "https://api.mixpeek.com/v1/organizations/connections",
    headers={"Authorization": "Bearer mxp_sk_..."},
    json={
        "name": "azure-media",
        "provider_type": "azure_blob",
        "provider_config": {
            "provider_type": "azure_blob",
            "account_name": "YOUR_STORAGE_ACCOUNT",
            "container": "YOUR_CONTAINER",
            "prefix": "media/",
            "credentials": {
                "type": "account_key",
                "account_name": "YOUR_STORAGE_ACCOUNT",
                "account_key": "YOUR_ACCESS_KEY",
            },
        },
        "test_before_save": True,
    },
)
```

> [!NOTE]
>
> The provider type is `azure_blob`. A bare `azure` returns HTTP 422.
>
> Managed identity uses `DefaultAzureCredential`. Set `client_id` only when you target a
> specific user-assigned identity; leave it out for the system-assigned one. `account_key`
> is redacted when you read the connection back.

## Verification

Once connected, Mixpeek should start discovering files in your specified Azure Blob container (and prefix, if provided). You can monitor the ingestion status within the Mixpeek Studio. Depending on your pipeline configuration, feature extraction and indexing will begin automatically for supported file types.

If you encounter issues, double-check the access permissions and the credentials provided in Mixpeek. Ensure the storage account name, container name, and authentication details are correct.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.