# Azure Blob Storage

> Connect Azure Blob Storage to sanda: what to prepare, the fields the connection form asks for, and how its data lands in your warehouse.

## Connect Azure Blob Storage

:::steps
1. **Open the catalogue.** In the console, go to **Data · Connections** and press **New connection**.
2. **Choose Azure Blob Storage.** It is listed under files and storage; you can also search for it by name.
3. **Fill in the form.** Enter the fields below. Credentials go straight to sanda’s sync engine and are never stored in sanda’s database.
4. **Choose what to sync.** Pick the tables you want, and a sync mode for each. See [choose what to sync](https://docs.sanda-os.com.au/connections/choose-tables).
5. **Run the first sync.** sanda tests the connection, then lands each table you chose in your warehouse.
:::

## Configuration fields

What the connection form asks for. Required fields are marked; the rest are optional.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| **Start Date** | string | No | UTC date and time in the format 2017-01-25T00:00:00.000000Z. Any file modified before this date will not be replicated. |
| **Authentication** | one of 3 options | Yes | Credentials for connecting to the Azure Blob Storage. |
| **Azure Blob Storage account name** | string | Yes | The account's name of the Azure Blob Storage. |
| **Azure blob storage container (Bucket) Name** | string | Yes | The name of the Azure blob storage container. |
| **Delivery Method** | one of 2 options | No |  |
| **The list of streams to sync** | array | Yes | Each item defines one table in your warehouse: which files belong in it, their format, and how they are parsed and validated. |
| **Endpoint Domain Name** | string | No | This is Azure Blob Storage endpoint domain name. Leave default value (or leave it empty if run container from command line) to use Microsoft native from example. |

### Authentication

Credentials for connecting to the Azure Blob Storage.

Choose one of the following. Each asks for its own fields.

**Authenticate via Oauth2**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| **Client ID** | string, secret | Yes | Client ID of your Microsoft developer application. |
| **Client Secret** | string, secret | Yes | Client Secret of your Microsoft developer application. |
| **Refresh Token** | string, secret | Yes | Refresh Token of your Microsoft developer application. |
| **Tenant ID** | string, secret | Yes | Tenant ID of the Microsoft Azure Application user. |

**Authenticate via Client Credentials**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| **Client ID** | string, secret | Yes | Client ID of your Microsoft developer application. |
| **Client Secret** | string, secret | Yes | Client Secret of your Microsoft developer application. |
| **Tenant ID** | string, secret | Yes | Tenant ID of the Microsoft Azure Application. |

**Authenticate via Storage Account Key**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| **Azure Blob Storage account key** | string, secret | Yes | The Azure blob storage account key. |


### Delivery Method


Choose one of the following. Each asks for its own fields.

**Replicate Records**

No further fields.

**Copy Raw Files**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| **Preserve Sub-Directories in File Paths** | boolean | No | If enabled, sends subdirectory folder structure along with source file names to the destination. Otherwise, files will be synced by their names only. This option is ignored when file-based replication is not enabled. Default `true`. |


## Related

:::links
- [Sync modes](https://docs.sanda-os.com.au/connections/sync-modes): How sanda reads each table on every run.
- [Sync schedules](https://docs.sanda-os.com.au/connections/schedules): How often a connection runs.
- [Allowlist sanda’s address](https://docs.sanda-os.com.au/connections/allowlist): For a system behind a firewall.
- [Troubleshoot connections](https://docs.sanda-os.com.au/connections/troubleshooting): What an error means and how to fix it.
:::
