az backup restore

從復原服務保存庫中的恢復點還原備份的專案。

命令

名稱 Description 類型 狀態
az backup restore files

授與恢復點所有檔案的存取權。

核心 GA
az backup restore files mount-rp

下載裝載恢復點檔案的腳本。

核心 GA
az backup restore files unmount-rp

關閉對恢復點的存取。

核心 GA
az backup restore restore-azurefiles

將檔案共用內的 Azure 檔案還原至相同的檔案共用,或已註冊記憶體帳戶中的另一個檔案共用。

核心 GA
az backup restore restore-azurefileshare

將備份的 Azure 檔案共用還原至已註冊記憶體帳戶中的相同檔案共用或其他檔案共用。

核心 GA
az backup restore restore-azurewl

將復原服務保存庫中備份的 Azure 工作負載還原至另一個已註冊的容器或相同的容器。

核心 GA
az backup restore restore-disks

從指定的恢復點還原備份 VM 的磁碟。

核心 GA

az backup restore restore-azurefiles

將檔案共用內的 Azure 檔案還原至相同的檔案共用,或已註冊記憶體帳戶中的另一個檔案共用。

az backup restore restore-azurefiles --resolve-conflict {Overwrite, Skip}
                                     --restore-mode {AlternateLocation, OriginalLocation}
                                     [--container-name]
                                     [--ids]
                                     [--item-name]
                                     [--resource-group]
                                     [--rp-name]
                                     [--source-file-path]
                                     [--source-file-type {Directory, File}]
                                     [--subscription]
                                     [--target-file-share]
                                     [--target-folder]
                                     [--target-storage-account]
                                     [--vault-name]

範例

將檔案共用內的 Azure 檔案還原至相同的檔案共用,或已註冊記憶體帳戶中的另一個檔案共用。

az backup restore restore-azurefiles --resource-group MyResourceGroup --vault-name MyVault --container-name MyContainer --item-name MyItem --rp-name recoverypoint --resolve-conflict Overwrite --restore-mode OriginalLocation --source-file-type File --source-file-path Filepath1 Filepath2

必要參數

--resolve-conflict

如果還原的數據發生衝突,則指示。

接受的值: Overwrite, Skip
--restore-mode

指定還原模式。

接受的值: AlternateLocation, OriginalLocation

選擇性參數

--container-name -c

備份容器的名稱。 接受 az backup container list 命令輸出中的 'Name' 或 'FriendlyName'。 如果傳遞 『FriendlyName』,則需要 BackupManagementType。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--item-name -i

備份項目的名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--rp-name -r

恢復點的名稱。

--source-file-path

要以字串的形式在檔案共享內還原之檔案的絕對路徑。 此路徑與 'az storage file download' 或 'az storage file show' CLI 命令中使用的路徑相同。

--source-file-type

指定要選取的來源檔類型。

接受的值: Directory, File
--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--target-file-share

將還原內容的目的地檔案共用。

--target-folder

將還原內容的目的地資料夾。 若要將內容還原至根目錄,請將資料夾名稱保留空白。

--target-storage-account

將還原內容的目的地記憶體帳戶。

--vault-name -v

復原服務保存庫的名稱。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az backup restore restore-azurefileshare

將備份的 Azure 檔案共用還原至已註冊記憶體帳戶中的相同檔案共用或其他檔案共用。

az backup restore restore-azurefileshare --resolve-conflict {Overwrite, Skip}
                                         --restore-mode {AlternateLocation, OriginalLocation}
                                         [--container-name]
                                         [--ids]
                                         [--item-name]
                                         [--resource-group]
                                         [--rp-name]
                                         [--subscription]
                                         [--target-file-share]
                                         [--target-folder]
                                         [--target-resource-group-name]
                                         [--target-storage-account]
                                         [--vault-name]

範例

將備份的 Azure 檔案共用還原至已註冊記憶體帳戶中的相同檔案共用或其他檔案共用。

az backup restore restore-azurefileshare --resource-group MyResourceGroup --vault-name MyVault --container-name MyContainer --item-name MyItem --rp-name recoverypoint --resolve-conflict Overwrite --restore-mode OriginalLocation

必要參數

--resolve-conflict

如果還原的數據發生衝突,則指示。

接受的值: Overwrite, Skip
--restore-mode

指定還原模式。

接受的值: AlternateLocation, OriginalLocation

選擇性參數

--container-name -c

備份容器的名稱。 接受 az backup container list 命令輸出中的 'Name' 或 'FriendlyName'。 如果傳遞 『FriendlyName』,則需要 BackupManagementType。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--item-name -i

備份項目的名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--rp-name -r

恢復點的名稱。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--target-file-share

將還原內容的目的地檔案共用。

--target-folder

將還原內容的目的地資料夾。 若要將內容還原至根目錄,請將資料夾名稱保留空白。

--target-resource-group-name --target-rg-name

將還原內容的目標記憶體帳戶資源群組,如果內容與保存庫資源群組不同,則需要資源群組。

--target-storage-account

將還原內容的目的地記憶體帳戶。

--vault-name -v

復原服務保存庫的名稱。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az backup restore restore-azurewl

將復原服務保存庫中備份的 Azure 工作負載還原至另一個已註冊的容器或相同的容器。

az backup restore restore-azurewl --recovery-config
                                  --resource-group
                                  --vault-name
                                  [--rehydration-duration]
                                  [--rehydration-priority {High, Standard}]
                                  [--use-secondary-region]

範例

將復原服務保存庫中備份的 Azure 工作負載還原至另一個已註冊的容器或相同的容器。

az backup restore restore-azurewl --resource-group MyResourceGroup --vault-name MyVault --recovery-config MyRecoveryConfig

必要參數

--recovery-config

指定備份項目的復原組態。 組態物件可以從 『backup recoveryconfig show』 命令取得。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--vault-name -v

復原服務保存庫的名稱。

選擇性參數

--rehydration-duration

設定最大時間,以天為單位(包括 10 到 30 之間,兩者皆包含),恢復點維持在凍結狀態。

預設值: 15
--rehydration-priority

重新凍結恢復點時要維護的優先順序類型。

接受的值: High, Standard
--use-secondary-region

使用此旗標從次要區域中的恢復點還原。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az backup restore restore-disks

從指定的恢復點還原備份 VM 的磁碟。

az backup restore restore-disks --storage-account
                                [--container-name]
                                [--disk-encryption-set-id]
                                [--diskslist]
                                [--ids]
                                [--item-name]
                                [--mi-system-assigned]
                                [--mi-user-assigned]
                                [--rehydration-duration]
                                [--rehydration-priority {High, Standard}]
                                [--resource-group]
                                [--restore-as-unmanaged-disks {false, true}]
                                [--restore-mode {AlternateLocation, OriginalLocation}]
                                [--restore-only-osdisk {false, true}]
                                [--restore-to-edge-zone {false, true}]
                                [--restore-to-staging-storage-account {false, true}]
                                [--rp-name]
                                [--storage-account-resource-group]
                                [--subscription]
                                [--target-resource-group]
                                [--target-subnet-name]
                                [--target-subscription-id]
                                [--target-vm-name]
                                [--target-vnet-name]
                                [--target-vnet-resource-group]
                                [--target-zone {1, 2, 3}]
                                [--use-secondary-region]
                                [--vault-name]

範例

從指定的恢復點還原備份 VM 的磁碟。 ( 自動產生 )

az backup restore restore-disks --container-name MyContainer --item-name MyItem --resource-group MyResourceGroup --rp-name MyRp --storage-account mystorageaccount --vault-name MyVault

必要參數

--storage-account

預備記憶體帳戶的名稱或標識碼。 VM 組態將會還原至此記憶體帳戶。 如需詳細資訊,請參閱 --restore-to-staging-storage-account 參數的說明。 跨區域還原可能需要標識符,其中記憶體帳戶和保存庫不在相同的資源群組上。 若要取得標識符,請使用記憶體帳戶 show 命令,如這裡所指定 (https://learn.microsoft.com/en-us/azure/storage/common/storage-account-get-info?tabs=azure-cli#get-the-resource-id-for-a-storage-account)。

選擇性參數

--container-name -c

備份容器的名稱。 接受 az backup container list 命令輸出中的 'Name' 或 'FriendlyName'。 如果傳遞 『FriendlyName』,則需要 BackupManagementType。

--disk-encryption-set-id

磁碟加密集標識碼用於加密還原的磁碟。 請確定存取這裡指定的磁碟加密集標識碼。

--diskslist

要排除或包含的磁碟清單。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--item-name -i

備份項目的名稱。

--mi-system-assigned

使用此旗標來指定系統指派的受控識別是否應該用於還原作業。 MI 選項不適用於還原非受控磁碟。

--mi-user-assigned

要用於還原作業的使用者指派受控識別的 ARM 識別碼。 如果您不想使用系統指派的MI來還原備份專案,請指定此參數的值。

--rehydration-duration

設定最大時間,以天為單位(包括 10 到 30 之間,兩者皆包含),恢復點維持在凍結狀態。

預設值: 15
--rehydration-priority

重新凍結恢復點時要維護的優先順序類型。

接受的值: High, Standard
--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--restore-as-unmanaged-disks

使用此旗標指定要還原為非受控磁碟。

接受的值: false, true
--restore-mode

指定還原模式。

接受的值: AlternateLocation, OriginalLocation
預設值: AlternateLocation
--restore-only-osdisk

使用此旗標僅還原備份 VM 的 OS 磁碟。

接受的值: false, true
--restore-to-edge-zone

切換參數以指出邊緣區域 VM 還原。 此參數不能用於跨區域和跨訂用帳戶還原案例。

接受的值: false, true
--restore-to-staging-storage-account

當您想要使用 --storage-account 參數將磁碟還原至預備記憶體帳戶時,請使用此旗標。 若未指定,磁碟將會還原至其原始記憶體帳戶。 預設:false。

接受的值: false, true
--rp-name -r

恢復點的名稱。

--storage-account-resource-group

包含記憶體帳戶的資源群組名稱。 如果未指定,預設值會與 --resource-group 相同。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--target-resource-group -t

使用此選項可指定將儲存還原磁碟的目標資源群組。

--target-subnet-name

在替代位置還原新 VM 的情況下,應在其中建立目標 VM 的子網名稱。

--target-subscription-id

應還原資源的訂用帳戶標識碼。

--target-vm-name

在替代位置還原至新 VM 的情況下,應該還原數據的 VM 名稱。

--target-vnet-name

應在其中建立目標 VM 的 VNet 名稱,在替代位置還原至新的 VM 時。

--target-vnet-resource-group

包含目標 VNet 的資源群組名稱,在替代位置還原至新的 VM 時。

--target-zone

主要區域目前可以有三個 Azure 可用性區域。 執行跨區域還原時,使用此自變數來指定目標區域編號。

接受的值: 1, 2, 3
--use-secondary-region

使用此旗標從次要區域中的恢復點還原。

--vault-name -v

復原服務保存庫的名稱。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。