# Azure Blob Storage

- Published on Sep 17, 2024
- 1 minute(s) read

## Azure Blob Storage setup

To set up Azure Blob Storage as a file store, include the following in the ".env" file:

```bash
FORMS_STORAGE_MODE=<AZURE_BB OR AZURE_BB_EX OR AZURE_BB_LEGACY>
IMAGE_STORAGE_AZURE_CONTAINER_NAME=<Name of your Azure Storage Blob Name>
IMAGE_STORAGE_AZURE_ACCOUNT_NAME=<Name of your Azure Storage Account Name>
IMAGE_STORAGE_AZURE_ACCOUNT_KEY=<Your Azure Storage Account Access Key>
```

> In v32 and later, you can choose to store your system-level credentials in a secrets manager. To learn more about our secrets-management integration, see [Secrets Management](https://help.hyperscience.ai/deployment/docs/secrets-management).

### Value of _FORMS_STORAGE_MODE_

In v36.0.6+ and v37 and later, file stores have a six-level directory structure. This structure minimizes the number of files in each directory, allowing for faster data retrieval and improving performance in high-volume instances. The value of _FORMS_STORAGE_MODE_ depends on the version of Hyperscience you're running:

- v36.0.6 + or v37 or later: _AZURE_BB_EX_
- v36.0.5 or earlier: _AZURE_BB_

If you are upgrading to v36.0.6+ or v37 or later, your file store will use the optimized directory structure by default. If you want to continue using the older directory structure, set _FORMS_STORAGE_MODE_ to _AZURE_BB_LEGACY_.

### Optional _IMAGE_STORAGE_AZURE_CUSTOM_DOMAIN_ variable

If you have set up a custom, private domain for your Azure file store, our default _blob.core.windows.net_ domain won't work for your instance. Instead, in v37.0.4 and later, you can add your custom domain to your Hyperscience configuration by adding the following to your ".env" file:

```bash
IMAGE_STORAGE_AZURE_CUSTOM_DOMAIN=<custom domain for the file store>
```

For example, if your custom domain is _xyz.example.com_, you would add:

```plaintext
IMAGE_STORAGE_AZURE_CUSTOM_DOMAIN=xyz.example.com
```
