在 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 檔案儲存體的共用快照集概觀