在 Azure Spring Apps 中使用持久存储

注意

Azure Spring Apps 是 Azure Spring Cloud 服务的新名称。 虽然该服务有新名称,但一些地方仍会使用旧名称,我们仍在更新屏幕截图、视频和图形等资产。

Azure Spring Apps 为应用程序提供两种类型的内置存储:持久和临时。

默认情况下,Azure Spring Apps 为每个应用程序实例提供临时存储。 每个实例的临时存储有 5 GB 的容量限制,其默认安装路径为 /tmp。

警告

重启应用程序实例会永久删除其关联的临时存储。

持久存储是由 Azure 托管的文件共享容器,按应用程序分配。 应用程序的所有实例共享存储在持久存储中的数据。 一个 Azure Spring Apps 实例最多有 10 个启用了持久存储的应用程序。 为每个应用程序分配 50 GB 的持久存储。 持久存储的默认装载路径为 /persistent。

启用或禁用内置持久存储

可以使用 Azure 门户或 Azure CLI 启用或禁用内置持久存储。

使用以下步骤通过 Azure 门户启用或禁用内置持久存储。

  1. 在 Azure 门户中转到 Azure Spring Apps 实例。

  2. 选择“应用”以查看服务实例的应用,然后选择一个应用以显示应用的“概述”页。

    Screenshot of Azure portal showing the Apps page.

  3. 在“概述”页面上,选择“配置”。

    Screenshot of Azure portal showing details for an app.

  4. 在“配置”页上,选择“持久存储”。

    Screenshot of Azure portal showing the Configuration page.

  5. 在“持久存储”选项卡上,选择“启用”以启用持久存储,或选择“禁用”以禁用持久存储。

    Screenshot of Azure portal showing the Persistent Storage tab.

如果启用了持久存储,则“持久存储”选项卡将显示存储大小和路径。

警告

如果禁用应用程序的持久存储,则所有存储都将解除分配,并且存储的所有数据都将永久丢失。

后续步骤