> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/app/setting-up-your-database/snowflake/connecting-to-snowflake/snowflake-temp-storage-azure.md).

# Azure - Setting the storage location for temporary files

During data generation, Structural uses temporary CSV files to load and unload Snowflake tables.

To store these temporary files, you can use either:

* Azure Blob Storage
* External stages

You can also provide separate locations for the source and destination files.

## Selecting the type of storage to use <a href="#snowflake-azure-temp-storage-type" id="snowflake-azure-temp-storage-type"></a>

Under **File Storage Options**, by default, the **Use External Stage** toggle is off, which indicates to use Azure Blob Storage for the temporary files.

To instead use external stages, toggle **Use External Stage** to the on position.

## Enabling separate paths for source and destination files <a href="#snowflake-azure-temp-storage-separate-paths" id="snowflake-azure-temp-storage-separate-paths"></a>

By default, you provide a single Azure Blob Storage or external stage. Within that path:

* During data generation, Structural copies source data CSV files to an `input` folder in the storage location.
* After it applies the generators, Structural copies destination data CSV files to an `output` folder.

To instead provide separate paths for the source and destination files, toggle **Use Separate Destination Location** to the on position.

## Setting the Azure Blob Storage location for temporary files <a href="#snowflake-azure-blob-storage-location" id="snowflake-azure-blob-storage-location"></a>

When **Use External Stage** is off, if **Use Separate Destination Location** is off, then:

1. In the **Source** **Azure Storage Account Name** field, provide the name of the account that Structural uses to load and unload Snowflake data in Azure Blob Storage. Do not provide the URI. You only need the account name.
2. In the **Source** **Azure Blob Storage Path** field, provide the container path to the Azure Blob Storage location where Structural places temporary CSV files that it uses to load and unload Snowflake tables.

If **Use Separate Destination Location** is on, then:

1. In the **Source** **Azure Storage Account Name** field, provide the name of the account that Structural uses to load and unload source Snowflake data in Azure Blob Storage. Do not provide the URI. You only need the account name.
2. In the **Source** **Azure Blob Storage Path** field, provide the container path to the Azure Blob Storage location where Structural places temporary source CSV files that it uses to load and unload Snowflake tables.
3. In the **Destination** **Azure Storage Account Name** field, provide the name of the account that Structural uses to write and read the temporary destination files.
4. In the **Destination** **Azure Blob Storage Path** field, provide the container path to the Azure Blob Storage location where Structural places the temporary destination files.

## Setting the external stage location for temporary files <a href="#snowflake-azure-external-stage-location" id="snowflake-azure-external-stage-location"></a>

When **Use External Stage** is on, you provide the path to the external stage or stages to use for temporary files.

The format is:

`<database>.<schema>.<stage>`

Where:

* `<database>` is the name of the database where the stage is located.
* `<schema>` is the name of the schema that contains the stage.
* `<stage>` is the name of the stage.

If **Use Separate Destination Location** is off, then in the **Source Snowflake External Stage Name** field, provide the path to the external stage.

If **Use Separate Destination Location** is on, then:

1. In the **Source Snowflake External Stage Name** field, provide the path to the external stage to use for the source files.
2. In the **Destination Snowflake External Stage Name** field, provide the path to the external stage use for the destination files.

## Providing the connection credentials

For the connection to the temporary file storage, under **Azure Credentials**, you configure the connection credentials.

You can either:

* On a self-hosted instance, use an environment setting value.
* Use a storage account key.
* Use a service principal. The service principal must be assigned the Storage Blob Data Contributor role in Azure. For more information, go to the [Azure documentation](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles/storage#storage-blob-data-contributor).

### Environment setting

On a self-hosted setting, to use the storage account key that is set as the value of the [environment setting](/app/admin/environment-variables-setting.md) `TONIC_AZURE_BLOB_STORAGE_ACCOUNT_KEY`, click **Environment**.

### Storage account key

To provide a storage account key to use for the connection:

1. Click **Storage Account Key**.
2. In the **Azure Blob Storage Account Key** field, provide the key.

### Service principal

To use a service principal for the connection:

1. Click **Service Principal**.
2. In the **Tenant ID** field, provide your Azure tenant identifier.
3. In the **Client ID** field, provide your Azure client identifier.
4. In the **Client Secret** field, provide your Azure client secret.

## Testing the storage location connection <a href="#storage-location-test-connection" id="storage-location-test-connection"></a>

To verify that Structural is able to use the provided credentials to connect to the storage location, click **Test Source Object Storage**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tonic.ai/app/setting-up-your-database/snowflake/connecting-to-snowflake/snowflake-temp-storage-azure.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
