@@ -73,54 +73,54 @@ To fetch the relevant recovery points, run the following cmdlets:
73
73
74
74
1. Fetch all instances using the `Get-AzDataProtectionBackupInstance` cmdlet and identify the relevant instance.
75
75
76
- ```azurepowershell
77
- $AllInstances = Get-AzDataProtectionBackupInstance -ResourceGroupName $vaultRgName -VaultName $vaultName
78
- ```
76
+ ```azurepowershell
77
+ $AllInstances = Get-AzDataProtectionBackupInstance -ResourceGroupName $vaultRgName -VaultName $vaultName
78
+ ```
79
79
80
80
To search across instances in multiple vaults and subscriptions, use `Az.Resourcegraph` and `Search-AzDataProtectionBackupInstanceInAzGraph` cmdlets.
81
81
82
- ```azurepowershell
83
- $AllInstances = Search-AzDataProtectionBackupInstanceInAzGraph -Subscription $vaultSubId -ResourceGroup $vaultRgName -Vault $vaultName -DatasourceType AzureKubernetesService -ProtectionStatus ProtectionConfigured
84
- ```
82
+ ```azurepowershell
83
+ $AllInstances = Search-AzDataProtectionBackupInstanceInAzGraph -Subscription $vaultSubId -ResourceGroup $vaultRgName -Vault $vaultName -DatasourceType AzureKubernetesService -ProtectionStatus ProtectionConfigured
84
+ ```
85
85
86
86
2. Once the instance is identified, fetch the relevant recovery point. From the output array of the given cmdlet, third backup instance is to be restored.
87
87
88
- ```azurepowershell
89
- $rp = Get-AzDataProtectionRecoveryPoint -ResourceGroupName $vaultRgName -VaultName $vaultName -BackupInstanceName $AllInstances[2].BackupInstanceName
90
- ```
88
+ ```azurepowershell
89
+ $rp = Get-AzDataProtectionRecoveryPoint -ResourceGroupName $vaultRgName -VaultName $vaultName -BackupInstanceName $AllInstances[2].BackupInstanceName
90
+ ```
91
91
92
92
### Prepare the restore request
93
93
94
94
To prepare the restore request, run the following cmdlets:
95
95
96
96
1. Prepare the restore configuration and define the items to be restored to the target AKS cluster by using the `New-AzDataProtectionRestoreConfigurationClientObject` cmdlet.
97
97
98
- ```azurepowershell
99
- $aksRestoreCriteria = New-AzDataProtectionRestoreConfigurationClientObject -DatasourceType AzureKubernetesService -PersistentVolumeRestoreMode RestoreWithVolumeData -IncludeClusterScopeResource $true -NamespaceMapping @{"sourceNamespace"="targetNamespace"}
100
- ```
98
+ ```azurepowershell
99
+ $aksRestoreCriteria = New-AzDataProtectionRestoreConfigurationClientObject -DatasourceType AzureKubernetesService -PersistentVolumeRestoreMode RestoreWithVolumeData -IncludeClusterScopeResource $true -NamespaceMapping @{"sourceNamespace"="targetNamespace"}
100
+ ```
101
101
102
102
2. Prepare the restore request with all relevant details by using the `Initialize-AzDataProtectionRestoreRequest` cmdlet.
103
103
104
104
For restore to the original AKS cluster, use the following cmdlet format:
105
105
106
- ```azurepowershell
107
- $aksRestoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureKubernetesService -SourceDataStore OperationalStore -RestoreLocation $restoreLocation -RestoreType OriginalLocation -RecoveryPoint $rp[0].Property.RecoveryPointId -RestoreConfiguration $aksRestoreCriteria -BackupInstance $AllInstances[2]
108
- ```
106
+ ```azurepowershell
107
+ $aksRestoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureKubernetesService -SourceDataStore OperationalStore -RestoreLocation $restoreLocation -RestoreType OriginalLocation -RecoveryPoint $rp[0].Property.RecoveryPointId -RestoreConfiguration $aksRestoreCriteria -BackupInstance $AllInstances[2]
108
+ ```
109
109
For restore to an alternate AKS cluster, use the following cmdlet format:
110
110
111
- ```azurepowershell
112
- $aksRestoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureKubernetesService -SourceDataStore OperationalStore -RestoreLocation $restoreLocation -RestoreType AlternateLocation -TargetResourceId $targetAKSClusterId -RecoveryPoint $rp[0].Property.RecoveryPointId -RestoreConfiguration $aksRestoreCriteria -BackupInstance $AllInstances[2]
113
- ```
111
+ ```azurepowershell
112
+ $aksRestoreRequest = Initialize-AzDataProtectionRestoreRequest -DatasourceType AzureKubernetesService -SourceDataStore OperationalStore -RestoreLocation $restoreLocation -RestoreType AlternateLocation -TargetResourceId $targetAKSClusterId -RecoveryPoint $rp[0].Property.RecoveryPointId -RestoreConfiguration $aksRestoreCriteria -BackupInstance $AllInstances[2]
113
+ ```
114
114
115
115
## Trigger the restore
116
116
117
117
To trigger the restore operation, run the following cmdlets:
118
118
119
119
1. Validate the restore request created earlier.
120
120
121
- ```azurepowershell
122
- $validateRestore = Test-AzDataProtectionBackupInstanceRestore -SubscriptionId $vaultSubId -ResourceGroupName $vaultRgName -VaultName $vaultName -RestoreRequest $aksRestoreRequest -Name $AllInstances[2].BackupInstanceName
123
- ```
121
+ ```azurepowershell
122
+ $validateRestore = Test-AzDataProtectionBackupInstanceRestore -SubscriptionId $vaultSubId -ResourceGroupName $vaultRgName -VaultName $vaultName -RestoreRequest $aksRestoreRequest -Name $AllInstances[2].BackupInstanceName
123
+ ```
124
124
125
125
>[!Note]
126
126
>During the restore operation, the Backup vault and the AKS cluster need to have certain roles assigned to perform the restore:
@@ -131,9 +131,9 @@ To trigger the restore operation, run the following cmdlets:
131
131
132
132
2. To trigger the restore operation with the request prepared earlier by using the `Start-AzDataProtectionBackupInstanceRestore` cmdlet.
133
133
134
- ```azurepowershell
135
- $restoreJob = Start-AzDataProtectionBackupInstanceRestore -SubscriptionId $vaultSubId -ResourceGroupName $vaultRgName -VaultName $vaultName -BackupInstanceName $AllInstances[2].BackupInstanceName -Parameter $aksRestoreRequest
136
- ```
134
+ ```azurepowershell
135
+ $restoreJob = Start-AzDataProtectionBackupInstanceRestore -SubscriptionId $vaultSubId -ResourceGroupName $vaultRgName -VaultName $vaultName -BackupInstanceName $AllInstances[2].BackupInstanceName -Parameter $aksRestoreRequest
136
+ ```
137
137
138
138
## Track the restore job
139
139
0 commit comments