跳到主内容

将文件存储在 Azure Blob Storage

本指南介绍如何将 Casdoor 上传的文件(如头像)存储在 Azure Blob Storage 中。


学习目标​

  • 查找存储账户的值。
  • 在 Casdoor 中添加 Azure Blob 作为存储提供商。

所需条件​

  • 一个包含容器的 Azure 存储账户
  • Casdoor 管理控制台的 Administrator 权限

在 Azure 中查找值​

ValueWhere to find it
AccountNameThe name of the storage account
AccountKeyThe storage account, Access keys
ContainerUrlThe properties of the container
ContainerNameThe name of the container, for example default
PrivateEndpoint可选。账户的 私有终结点
DomainOptional. A custom domain, such as one of Azure CDN

Access keys of the storage account

URL of the container

Name of the container

Azure CDN domain

在 Casdoor 中添加提供商​

  1. 在 Casdoor 管理控制台中,前往 Identity > Providers 并添加一个提供商。

  2. 将 Category 设置为 Storage,将 Type 设置为 Azure Blob。

    Azure Blob type selection

  3. 填写以下字段:

    字段Azure 对应项 / 含义必需的
    Client IDAccountName是
    Client secretAccountKey是
    EndpointContainerUrl是
    Endpoint (Intranet)PrivateEndpoint不
    BucketContainerName是
    Path prefix路径前缀不
    Domain自定义域名(例如 CDN)不
  4. 保存提供商.

    Azure Blob provider in Casdoor

另请参阅​