# Azure Blob Store

该指南介绍了如何配置Alluxio以使用[Azure Blob Store](https://azure.microsoft.com/en-in/services/storage/blobs/)作为底层存储系统。

## 先决条件

为了在Alluxio上使用Azure Blob Store，你需要在Azure storage帐户上创建一个新的container或者使用一个已有的container。\
你还需要关注在这个container里使用的目录，你可以在这个container里面创建一个目录，或者使用一个已有的目录。\
在该指南中，我们将Azure storage帐户名称为`<AZURE_ACCOUNT>`，将帐户里的container称为`<AZURE_CONTAINER>`，并将该container里面的目录\
称为`<AZURE_DIRECTORY>`。点击[这里](https://docs.microsoft.com/en-us/azure/storage/storage-create-storage-account)查看更多关于Azure storage帐户的信息。

## 基本设置

使用 [挂载表操作](https://documentation.alluxio.io/ee-ai-cn/ai-3.6/ufs/pages/vItTjDEwYA3ygh6WezO1#挂载表操作) 添加新的挂载点，指定创建挂载点的Alluxio 路径，并将 Azure Blob Store 路径指定为 UFS URI。\
凭证和配置选项也可以作为挂载命令的一部分，通过指定 `--option` 标签来进行配置，详见 [配置挂载点](https://documentation.alluxio.io/ee-ai-cn/ai-3.6/ufs/pages/vItTjDEwYA3ygh6WezO1#对不同挂载点使用不同的配置)。

以下是通过 Operator 创建挂载点的 `ufs.yaml` 文件示例：

```yaml
apiVersion: k8s-operator.alluxio.com/v1
kind: UnderFileSystem
metadata:
  name: alluxio-wasbs
  namespace: alx-ns
spec:
  alluxioCluster: alluxio-cluster
  path: wasbs://<AZURE_CONTAINER>@<AZURE_ACCOUNT>.blob.core.windows.net/<AZURE_DIRECTORY>/
  mountPath: /wasbs
  mountOptions:
    fs.azure.account.key.<AZURE_ACCOUNT>.blob.core.windows.net: <YOUR ACCESS KEY>
```

不使用 Operator 的情况下, 将 `wasbs://<AZURE_CONTAINER>@<AZURE_ACCOUNT>.blob.core.windows.net/<AZURE_DIRECTORY>/` 挂载到 `/wasbs` 的命令示例如下:

```shell
bin/alluxio mount add --path /wasbs/ --ufs-uri wasbs://<AZURE_CONTAINER>@<AZURE_ACCOUNT>.blob.core.windows.net/<AZURE_DIRECTORY>/ \
  --option fs.azure.account.key.<AZURE_ACCOUNT>.blob.core.windows.net=<YOUR ACCESS KEY>
```

属性键 `fs.azure.account.key.<AZURE_ACCOUNT>.blob.core.windows.net` 将会让Alluxio使用 AccountKey 来访问 Azure Blob Store.

## FAQ

### 如果出现 http not support 错误该怎么做？

如果你挂载 Blob 时将 Blob 路径以 `wasb://` 开头，你可能会看到如下错误：

```
alluxio.exception.AlluxioException: com.microsoft.azure.storage.StorageException: The account being accessed does not support http.
```

你可以将 Blob 路径改为以 `wasbs://` 开头。


---

# 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://documentation.alluxio.io/ee-ai-cn/ai-3.6/ufs/azure-blob-store.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.
