In this guide, we’ll link a private Azure storage account blob container to a Valohai project.
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
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.
- Create an Azure Storage Account in your Microsoft Azure subscription.
- Select storage account name and location. Create the storage account in the location you’ll be running your work to reduce transfer costs.
- Click on Containers on the navigation bar on the right side.
- Click on + Container.
- Give the container a name like valohai-sample and keep the public access level as Private.
- Click Create.
CORS Settings
What is CORS?
CORS is an HTTP feature that enables a web application running under one domain (app.valohai.com) to access resources in another domain (your storage). Read more at Microsoft Docs.
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.
- Click on CORS on the navigation bar on the right side.
- Make sure the Blob service tab is selected.
- Add the following 2 lines of configuration:
Origins | Methods | Allowed Headers | Exposed Headers | Max Age |
---|---|---|---|---|
* | GET,OPTIONS | content-type,x-ms-* | x-ms-meta-* | 3000 |
https://app.valohai.com | POST,PUT | content-type,x-ms-* | x-ms-meta-* | 3000 |
Now your blob container allows uploads through https://app.valohai.com web application.
Access Key
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
You can connect this data store either to a single project, or create it on the organization level.
Link to a Valohai organization
- Login at https://app.valohai.com
- Navigate to Hi,
<name>
(the top-right menu) > Manage<organization>
. - Open the Data Stores tab and add your store’s details.
- 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
Data Stores can be either configured on the project level or shared across your organization.
Default data store for project
- Open a project in the web application.
- Click on the Data Store table.
- Click on Add Azure Blob Storage Store.
- Add in the details you created in the Azure portal.
- The store name is the name that will be visible on Valohai. Make it something you recognize (e.g.
<organization-name>-store
). - (optional) Click on Make project default store to make it the default upload location for this project.
- When you create the store, the provided access key will be validated.