# Azure Blob Storage

## Azure Blob Storage <a href="#article-title" id="article-title"></a>

On Azure, you create storage accounts that have multiple services attached. One of those services is blob container, which is Valohai’s main interface on Azure-based installations.

Requirements

* A Microsoft Azure subscription you can administer
* A Valohai project which to link the Azure Blob Storage to

### Storage Account and Container <a href="#id-1-storage-account-and-container" id="id-1-storage-account-and-container"></a>

Using an existing Azure Blob storage

You can skip this part and go directly to the next section if you’re using an existing Storage container.

1. Create an Azure Storage Account in your Microsoft Azure subscription.
2. Select storage account name and location. Create the storage account in the location you’ll be running your work to reduce transfer costs.
3. Click on Containers on the navigation bar on the right side.
4. Click on + Container.
5. Give the container a name like valohai-sample and keep the public access level as Private.
6. Click Create.

### CORS Settings <a href="#id-2-cors-settings" id="id-2-cors-settings"></a>

What is CORS?

CORS is an HTTP feature that enables a web application running under one domain (**app.valohai.com** for example) to access resources in another domain (your storage). Read more at [Microsoft Docs](https://docs.microsoft.com/en-us/azure/storage/common/storage-cors-support).

If you wish to be able to upload files to the store using the **app.valohai.com** web UI, you will need to add a CORS policy document to the blob container.

1. Click on CORS on the navigation bar on the right side.
2. Make sure the Blob service tab is selected.
3. Add the following 2 lines of configuration:

<table><thead><tr><th width="191.5">Origins</th><th width="123.25">Methods</th><th width="174">Allowed Headers</th><th width="159.25">Exposed Headers</th><th width="100">Max Age</th></tr></thead><tbody><tr><td>*</td><td>GET,OPTIONS</td><td>content-type,x-ms-*</td><td>x-ms-meta-*</td><td>3000</td></tr><tr><td>https://app.valohai.com</td><td>POST,PUT</td><td>content-type,x-ms-*</td><td>x-ms-meta-*</td><td>3000</td></tr></tbody></table>

Now your blob container allows uploads through **<https://app.valohai.com>** web application.

### Access Key <a href="#id-3-access-key" id="id-3-access-key"></a>

Using the Azure portal, find and save the access key under the storage account Access keys tab. This will be added to Valohai in the next step.

### Add the store to Valohai <a href="#id-4-add-the-store-to-valohai" id="id-4-add-the-store-to-valohai"></a>

You can connect this data store either to a single project, or create it on the organization level.

#### Link to a Valohai organization <a href="#id-5-link-to-a-valohai-organization" id="id-5-link-to-a-valohai-organization"></a>

1. Login at <https://app.valohai.com>
2. Navigate to Hi, `<name>` (the top-right menu) > Manage `<organization>`.
3. Open the Data Stores tab and add your store’s details.
4. The data store can be shared with everyone in the organization, or you can expose the data store to only certain team(s).

#### Link the store to a Valohai project <a href="#id-6-link-the-store-to-a-valohai-project" id="id-6-link-the-store-to-a-valohai-project"></a>

Data Stores can be either configured on the project level or shared across your organization.

#### Default data store for project <a href="#id-7-default-data-store-for-project" id="id-7-default-data-store-for-project"></a>

1. Open a project in the web application.
2. Click on the **Data Store** table.
3. Click on **Add Azure Blob Storage Store**.
4. Add in the details you created in the Azure portal.
5. The store name is the name that will be visible on Valohai. Make it something you recognize (e.g. `<organization-name>-store`).
6. (optional) Click on Make project default store to make it the default upload location for this project.
7. When you create the store, the provided access key will be validated.


---

# Agent Instructions: 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:

```
GET https://docs.valohai.com/data/configure-data-stores/azure-blob-storage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
