Skip to content

Commit ab44cbc

Browse files
author
AbhishekMallick01
committed
minor changes
1 parent aa2d084 commit ab44cbc

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

articles/backup/azure-kubernetes-service-cluster-restore-using-powershell.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -73,54 +73,54 @@ To fetch the relevant recovery points, run the following cmdlets:
7373
7474
1. Fetch all instances using the `Get-AzDataProtectionBackupInstance` cmdlet and identify the relevant instance.
7575
76-
```azurepowershell
77-
$AllInstances = Get-AzDataProtectionBackupInstance -ResourceGroupName $vaultRgName -VaultName $vaultName
78-
```
76+
```azurepowershell
77+
$AllInstances = Get-AzDataProtectionBackupInstance -ResourceGroupName $vaultRgName -VaultName $vaultName
78+
```
7979
8080
To search across instances in multiple vaults and subscriptions, use `Az.Resourcegraph` and `Search-AzDataProtectionBackupInstanceInAzGraph` cmdlets.
8181
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+
```
8585
8686
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.
8787
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+
```
9191
9292
### Prepare the restore request
9393
9494
To prepare the restore request, run the following cmdlets:
9595
9696
1. Prepare the restore configuration and define the items to be restored to the target AKS cluster by using the `New-AzDataProtectionRestoreConfigurationClientObject` cmdlet.
9797
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+
```
101101
102102
2. Prepare the restore request with all relevant details by using the `Initialize-AzDataProtectionRestoreRequest` cmdlet.
103103
104104
For restore to the original AKS cluster, use the following cmdlet format:
105105
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+
```
109109
For restore to an alternate AKS cluster, use the following cmdlet format:
110110
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+
```
114114
115115
## Trigger the restore
116116
117117
To trigger the restore operation, run the following cmdlets:
118118
119119
1. Validate the restore request created earlier.
120120
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+
```
124124
125125
>[!Note]
126126
>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:
131131
132132
2. To trigger the restore operation with the request prepared earlier by using the `Start-AzDataProtectionBackupInstanceRestore` cmdlet.
133133
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+
```
137137
138138
## Track the restore job
139139

0 commit comments

Comments
 (0)