将文件存储在 Azure Blob Storage
本指南介绍如何将 Casdoor 上传的文件(如头像)存储在 Azure Blob Storage 中。
学习目标
- 查找存储账户的值。
- 在 Casdoor 中添加 Azure Blob 作为存储提供商。
所需条件
- 一个包含容器的 Azure 存储账户
- Casdoor 管理控制台的 Administrator 权限
在 Azure 中查找值
| Value | Where to find it |
|---|---|
| AccountName | The name of the storage account |
| AccountKey | The storage account, Access keys |
| ContainerUrl | The properties of the container |
| ContainerName | The name of the container, for example default |
| PrivateEndpoint | 可选。账户的 私有终结点 |
| Domain | Optional. A custom domain, such as one of Azure CDN |




在 Casdoor 中添加提供商
-
在 Casdoor 管理控制台中,前往 Identity > Providers 并添加一个提供商。
-
将 Category 设置为
Storage,将 Type 设置为Azure Blob。
-
填写以下字段:
字段 Azure 对应项 / 含义 必需的 Client ID AccountName 是 Client secret AccountKey 是 Endpoint ContainerUrl 是 Endpoint (Intranet) PrivateEndpoint 不 Bucket ContainerName 是 Path prefix 路径前缀 不 Domain 自定义域名(例如 CDN) 不 -
保存提供商.
