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

# Azure Storage

> Configure Azure Blob Storage for Tembo self-hosted on Azure.

Tembo can use an Azure Blob Storage container as a single store for file uploads and VM snapshots. If you skip this configuration, file uploads are unavailable and sandboxes start more slowly.

***

## Step 1: Create a Storage Account

### Via the Azure CLI

```bash theme={null}
az storage account create \
  --name <storage-account-name> \
  --resource-group tembo-self-hosted-rg \
  --location eastus \
  --sku Standard_LRS
```

### Via the Azure Portal

1. Go to **Storage accounts** → **+ Create**
2. Select your subscription and resource group
3. Enter a **Storage account name** (globally unique, 3–24 characters, lowercase alphanumeric only)
4. Choose your **Region**
5. Leave **Redundancy** as **Locally-redundant storage (LRS)**
6. Click **Review + create**, then **Create**

***

## Step 2: Create the Container

### Via the Azure CLI

```bash theme={null}
az storage container create \
  --name <container-name> \
  --account-name <storage-account-name>
```

### Via the Azure Portal

1. Go to **Storage accounts** → select your account
2. In the left sidebar, under **Data storage**, click **Containers**
3. Click **+ Container**
4. Enter a name and click **Create**

***

## Step 3: Get the Account Key

### Via the Azure CLI

```bash theme={null}
az storage account keys list \
  --account-name <storage-account-name> \
  --resource-group tembo-self-hosted-rg \
  --query "[0].value" -o tsv
```

### Via the Azure Portal

1. Go to **Storage accounts** → select your account
2. In the left sidebar, under **Security + networking**, click **Access keys**
3. Click **Show** next to **key1** and copy the **Key** value

***

## Step 4: Configure CORS

Tembo uploads image attachments directly from the browser to the storage container. Azure blocks these cross-origin requests by default, so you must add a CORS rule.

### Via the Azure CLI

```bash theme={null}
az storage cors add \
  --account-name <storage-account-name> \
  --services b \
  --methods DELETE GET HEAD OPTIONS PUT \
  --origins 'http://<vm-ip>' \
  --allowed-headers '*' \
  --exposed-headers '*' \
  --max-age 3600
```

If you are using a custom domain, replace `http://<vm-ip>` with your domain.

### Via the Azure Portal

1. Go to **Storage accounts** → select your account
2. In the left sidebar, under **Settings**, click **Resource sharing (CORS)**
3. Select the **Blob service** tab
4. Click **+ Add** and fill in:
   * **Allowed origins**: `http://<vm-ip>` (or your domain)
   * **Allowed methods**: `DELETE`, `GET`, `HEAD`, `OPTIONS`, `PUT`
   * **Allowed headers**: `*`
   * **Exposed headers**: `*`
   * **Max age**: `3600`
5. Click **Save**

***

## Step 5: Add to config.json

Open `/var/lib/tembo/config.json` (via the VS Code server at `http://<vm-ip>:8888` or SSH) and add:

```json theme={null}
{
  "selfHosted.objectStorage.provider": "azure",
  "selfHosted.objectStorage.bucket": "<container-name>",
  "selfHosted.objectStorage.azure.storageAccountName": "<storage-account-name>",
  "selfHosted.objectStorage.azure.storageAccountKey": "<account-key>"
}
```

> [!TIP]
>
> You can also enter these values under **Settings → Self-hosted → Object storage** on your instance, then select **Restart Services**.

Then restart all Tembo services:

```bash theme={null}
sudo systemctl restart 'tembo-ts-*'
```

Restarting only the API is not enough. Agent workers and the VM manager handle VM snapshots and read `config.json` only when they start.


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