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

# Azure Blob Storage

# Connector Details

| Name           | Value                                                                                                                                                                                                                                                                                                             |
| :------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Platform       | [Azure Blob Storage](https://azure.microsoft.com)                                                                                                                                                                                                                                                                 |
| Auth Type      | API Keys                                                                                                                                                                                                                                                                                                          |
| Direction      | Bidirectional                                                                                                                                                                                                                                                                                                     |
| Tap Repo       | [https://github.com/hotgluexyz/tap-blob-storage](https://github.com/hotgluexyz/tap-blob-storage)                                                                                                                                                                                                                  |
| Target Repo    | [https://github.com/hotgluexyz/target-blob-storage](https://github.com/hotgluexyz/target-blob-storage)                                                                                                                                                                                                            |
| Tap Metrics    | <p>Usage: <Tooltip tip="medium"><Icon icon="user" iconType="regular" color="#fff" size="14px" /><Icon icon="user" iconType="regular" color="#fff" size="14px" /><Icon icon="user" iconType="regular" color="#fff" size="14px" /><Icon icon="user" iconType="regular" color="#A9A9A9" size="14px" /></Tooltip></p> |
| Target Metrics | <p>Usage: <Tooltip tip="high"><Icon icon="user" iconType="regular" color="#fff" size="14px" /><Icon icon="user" iconType="regular" color="#fff" size="14px" /><Icon icon="user" iconType="regular" color="#fff" size="14px" /><Icon icon="user" iconType="regular" color="#fff" size="14px" /></Tooltip></p>      |

# Credentials Setup

Follow the steps below to get the credentials you need to use the Azure Blob Storage connector.

# How to get your Blob Storage credentials

The Blob Storage requires only a connection string to connect to your Blob Storage.

To find your connection string, log in to your Azure Portal and navigate to [your Storage Accounts Dashboard](https://portal.azure.com/#browse/Microsoft.Storage%2FStorageAccounts),

<img src="https://mintcdn.com/hotglue/5Ve6qyQIr-eWU9BP/connectors/images/AzureStorageAccts.png?fit=max&auto=format&n=5Ve6qyQIr-eWU9BP&q=85&s=7314e9e2ffcebad2e46e5a97550c7dae" alt="Azure Storage Accounts" width="2250" height="1180" data-path="connectors/images/AzureStorageAccts.png" />

Next, select your Storage Account, and navigate to **Security + Networking > Access Keys** and copy one of your connection strings.

You'll then paste this connection string directly into the Hotglue dashboard or into a config object, depending on how you are linking your connector.

<img src="https://mintcdn.com/hotglue/5Ve6qyQIr-eWU9BP/connectors/images/AzureConnectString.png?fit=max&auto=format&n=5Ve6qyQIr-eWU9BP&q=85&s=767b30bf990c702edc0349507c2cb038" alt="Azure Connection String" width="3008" height="1458" data-path="connectors/images/AzureConnectString.png" />

# Target Blob Storage

## Config

In addition to the `connect_string` parameter, you should specify the following fields when connecting:

```json theme={null}
{
    "connect_string": "...",
    "container": "...", // Container name to write to
    "path_prefix": "...", // Directory to insert files into
    "overwrite": true // Whether to overwrite files (defaults False)
}
```

## Example ETL Script

```python theme={null}
import gluestick as gs
import os
import time

# Define standard Hotglue directories
ROOT_DIR = os.environ.get("ROOT_DIR", ".")
INPUT_DIR = f"{ROOT_DIR}/sync-output"
OUTPUT_DIR = f"{ROOT_DIR}/etl-output"


# Read sync output
input = gs.Reader()

# Get tenant id
tenant_id = os.environ.get('USER_ID', os.environ.get('TENANT', 'default'))

# Possible values parquet, singer, csv, json, jsonl
EXPORT_FORMAT = "parquet"

# Iterate through the different streams in the sync output
for key in eval(str(input)):
    input_df = input.get(key)

    # Include tenant_id as a field if desired
    input_df["tenant"] = tenant_id

    # Create a unique file name
    timestamp = int(time.time()) # Unix Time stamp
    file_name = f"{tenant_id}_{key}_{timestamp}"

    # Write tenantid_streamname_timestamp.parquet
    gs.to_export(input_df, file_name, OUTPUT_DIR, export_format=EXPORT_FORMAT)
```

# Target Changelog

<Accordion title="Target Changelog">
  | Version                                                                         | Notes |
  | :------------------------------------------------------------------------------ | :---- |
  | [v0.0.1](https://github.com/hotgluexyz/target-blob-storage/releases/tag/v0.0.1) |       |
</Accordion>
