在 Azure 文件共享上启用软删除

Azure 文件存储为 SMB 文件共享提供软删除,方便你在应用程序或其他存储帐户用户错误地删除数据后轻松地恢复数据。 若要了解有关软删除的详细信息,请参阅如何防止意外删除 Azure 文件共享

适用于

文件共享类型 SMB NFS
标准文件共享 (GPv2)、LRS/ZRS Yes No
标准文件共享 (GPv2)、GRS/GZRS Yes No
高级文件共享 (FileStorage)、LRS/ZRS Yes No

先决条件

入门

以下部分说明如何在现有存储帐户上为 Azure 文件共享启用和使用软删除:

  1. 登录到 Azure 门户

  2. 导航到存储帐户,然后在“数据存储”下选择“文件共享” 。

  3. 选择“软删除”旁边的“已禁用”。 将显示“软删除设置”窗格。

  4. 为“软删除所有文件共享”选择“已启用” 。

  5. 文件共享保留期(以天为单位)下,使用滑块指定介于 1 到 365 天之间的数字。

  6. 选择“保存”以确认数据保留设置。

    Screenshot of the storage account soft delete settings pane. Highlighting the file shares soft delete section, enable toggle, set a retention period, and save. This will enable soft delete for all file shares in your storage account.

还原软删除的文件共享

若要还原软删除的文件共享:

  1. 导航到存储帐户,然后选择“文件共享”。

  2. 在“文件共享”边栏选项卡上,启用“显示删除的共享”显示已软删除的所有共享。

    这会显示当前处于“已删除”状态的所有共享。

    If the status column, the column next to the name column, is set to Deleted, then your file share is in a soft deleted state. And will be permanently deleted after your specified retention period.

  3. 选择共享并选择“取消删除”。 这将还原共享。

    可以确认共享已还原,因为其状态切换为“活动”。

    If the status column, the column next to the name column, is set to Active, then your file share has been restored.

禁用软删除

如果希望停止使用软删除,请按照以下说明操作。 若要永久删除已软删除的文件共享,必须将其撤销删除并禁用软删除,然后再次将其删除。

  1. 导航到存储帐户,然后在“数据存储”下选择“文件共享” 。

  2. 选择“软删除”旁边的“已启用” 。 将显示“软删除设置”窗格。

  3. 为“软删除所有文件共享”选择“已禁用” 。

  4. 选择“保存”以确认数据保留设置。

    Disabling soft delete will allow you to immediately and permanently delete all file shares in your storage account.

后续步骤

若要了解其他形式的数据保护和恢复,请参阅 Azure 文件存储的共享快照概述