# Setting Azure blob storage as snapshot repository for CrateDB

**URL:** <https://community.cratedb.com/t/setting-azure-blob-storage-as-snapshot-repository-for-cratedb/695>\
**Category:** Tutorials\
**Tags:** integration, data-storage\
**Created:** [June 2, 2021, 3:51pm UTC](https://community.cratedb.com/t/setting-azure-blob-storage-as-snapshot-repository-for-cratedb/695 "2021-06-02T15:51:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![proddata](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/proddata/32/1379_2.png) [@proddata](https://community.cratedb.com/u/proddata)\
**Post date:** [June 2, 2021, 3:51pm UTC](https://community.cratedb.com/t/setting-azure-blob-storage-as-snapshot-repository-for-cratedb/695/1 "2021-06-02T15:51:34Z")

</div>

1. Create a new **Storage Account** in Microsoft Azure
2. Create a new **Container** in the Storage Account
3. Get you **Access keys** for the Container (`Security + networking > Access Keys`)
4. In your CrateDB Cluster create a new **repository**
  - You will need:
    - **Storage Account name** (e.g. `cratetest`)
    - **Container name** (e.g. `cratebackup`)
    - **Access Key** (e.g. `/YDcp3IIJz4DIgSgWEGA3T8NhfOOCrm6EaDLaeqycgyZEXOg==`)

  - Create the repo:

```sql
CREATE REPOSITORY azurerepo TYPE azure
WITH (account = 'cratetest',
      container = 'cratebackup',
      key ='/YDcp3IIJz4DIgSgWEGA3T8NhfOOCrm6EaDLaeqycgyZEXOg==');

```

5. Create your first **snapshot**

```sql
CREATE SNAPSHOT azurerepo.first_snapshot TABLE my_table;

```

For the full configuration options see [CREATE REPOSITORY — CrateDB: Reference](https://crate.io/docs/crate/reference/en/latest/sql/statements/create-repository.html#azure)  
For more information on snapshots and repositories see [Snapshots — CrateDB: Reference](https://crate.io/docs/crate/reference/en/latest/admin/snapshots.html)

---

<div class="post-metadata">

**Author:** ![amotl](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/amotl/32/617_2.png) [@amotl](https://community.cratedb.com/u/amotl)\
**Post date:** [February 12, 2026, 2:03am UTC](https://community.cratedb.com/t/setting-azure-blob-storage-as-snapshot-repository-for-cratedb/695/2 "2026-02-12T02:03:43Z")

</div>

Hi. I wanted to explore this feature in a [testbed](https://github.com/crate/cratedb-toolkit/blob/v0.0.42/tests/retention/test_cli.py#L320-L364) against an [Azurite](https://github.com/Azure/Azurite) instance to support the [SNAPSHOT policy](https://cratedb-toolkit.readthedocs.io/retention.html#snapshot) of CrateDB Toolkit’s retention and expiration subsystem.

It took me a while to figure out that I must actually use [IP-style URI addressing](https://github.com/Azure/Azurite#ip-style-url) and a few additional cycles how to map this to the right incantation of CrateDB’s `CREATE REPOSITORY` command, specifically its `endpoint` parameter.

First, create a storage container called `example`, for example using [azure-cli](https://pypi.org/project/azure-cli/) \[1\].

```shell
export AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;QueueEndpoint=http://azurite:10001/devstoreaccount1;TableEndpoint=http://azurite:10002/devstoreaccount1;"
uv run --with='azure-cli==2.81' az storage container create --public-access=container --name=example

```

Then, create/register the repository in CrateDB, for example using [crash](https://pypi.org/project/crash/).

```sql
CREATE REPOSITORY
    testrepo
TYPE
    azure
WITH (
    endpoint = 'http://azurite:10000/devstoreaccount1',
    account = 'devstoreaccount1',
    key = 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==',
    container = 'example'
);

```

The whole setup is wrapped up into the attached `compose.yaml` file, to be invoked with [Docker Compose](https://docs.docker.com/compose/) or [Podman Compose](https://podman-desktop.io/docs/compose).

[compose.yaml](https://community.cratedb.com/uploads/short-url/63ok3ZEXD3HxldYvChWSe6gpxXj.yaml) (2.8 KB)

After downloading the file to your machine, invoke the service definition.

```shell
export BUILDKIT_PROGRESS=plain
docker compose up

```

Then, invoke the `CREATE REPOSITORY` command against CrateDB.

```shell
docker compose run --rm repository

```

* * *

1. As of 2026-02-12, please use azure-cli 2.81 with current Azurite ~3.35.

---

<div class="post-metadata">

**Author:** ![Carol\_2345](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@Carol\_2345](https://community.cratedb.com/u/Carol_2345)\
**Post date:** [June 9, 2026, 9:26am UTC](https://community.cratedb.com/t/setting-azure-blob-storage-as-snapshot-repository-for-cratedb/695/3 "2026-06-09T09:26:55Z")

</div>

The `endpoint` setting is usually the tricky part when using Azure blob storage with Azurite. While working through a similar setup, I found [Microsoft Azure DP-100 Training](https://cloudfoundation.com/microsoft-azure-dp-100-training/) useful for understanding Azure Storage concepts, and once the repository is created, it’s worth running a quick snapshot test to verify everything is working end-to-end.
