Skip to content

Azure Blob Storage

Azure Blob Storage can be used as a shared object-store for XTDB’s remote storage module.

Setup

First, ensure the com.xtdb/xtdb-azure Maven dependency is added to your XTDB node.

Infrastructure

Note
Resource Manager template

We provide a parameterized 'Azure Resource Manager' stack to help set up everything that you need.

To use Azure Blob Storage as the object store, the following infrastructure is required:

  1. An Azure Storage Account, containing a Storage Account Container.

{
  "permissions": [
    {
      "actions": [
        "Microsoft.Storage/storageAccounts/blobServices/containers/write",
        "Microsoft.Storage/storageAccounts/blobServices/containers/delete",
        "Microsoft.Storage/storageAccounts/blobServices/containers/read",
      ],
      "notActions": [],
      "dataActions": [
        "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read",
        "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write",
        "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/delete",
        "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/add/action",
        "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/move/action"
      ],
      "notDataActions": []
    }
  ]
}

Authentication

Authentication is done via the Azure SDK, which uses the DefaultAzureCredential. See the Azure Documentation for setup instructions.

Configuration

To use the Azure module, include the following in your node configuration:

storage: !Remote
  objectStore: !Azure
    # -- required

    # --- At least one of storageAccount or storageAccountEndpoint is required

    # The name of the storage account which has the storage container
    # (Can be set as an !Env value)
    storageAccount: storage-account

    # The full endpoint of the storage account which has the storage container
    # (Can be set as an !Env value)
    # storageAccountEndpoint: https://storage-account.privatelink.blob.core.windows.net

    # The name of the blob storage container to be used as the object store
    # (Can be set as an !Env value)
    container: xtdb-container

    # -- optional
    # A file path to prefix all of your files with
    # - for example, if "foo" is provided, all XTDB files will be located under a "foo" sub-directory
    # (Can be set as an !Env value)
    # prefix: my-xtdb-node
    #
    # Azure Client ID of a User Assigned Managed Identity -
    # required when using them for authentication to Azure Services ie, inside of an Azure App Container.
    # (Can be set as an !Env value)
    # userManagedIdentityClientId: user-managed-identity-client-id

  localDiskCache: /var/cache/xtdb/object-store