Skip to content

Commit

Permalink
Adding identityBasedRestoreDetails optional property for the customer…
Browse files Browse the repository at this point in the history
…s to be able to specify target storage account id when wanting to do restore using managed identities. (#15933)
  • Loading branch information
monikajainms authored Sep 14, 2021
1 parent 42185a2 commit 39fa4ce
Show file tree
Hide file tree
Showing 6 changed files with 254 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@
"x-ms-examples": {
"Trigger Cross Region Restore": {
"$ref": "./examples/AzureIaasVm/TriggerCrossRegionRestore_Post.json"
},
"Trigger Cross Region Restore with identityBasedRestoreDetails": {
"$ref": "./examples/AzureIaasVm/TriggerCrossRegionRestore_IdentityBasedRestoreDetails_Post.json"
}
}
}
Expand Down Expand Up @@ -3161,10 +3164,28 @@
"identityInfo": {
"$ref": "#/definitions/IdentityInfo",
"description": "Managed Identity information required to access customer storage account."
},
"identityBasedRestoreDetails": {
"$ref": "#/definitions/IdentityBasedRestoreDetails",
"description": "IaaS VM workload specific restore details for restores using managed identity."
}
},
"x-ms-discriminator-value": "IaasVMRestoreRequest"
},
"IdentityBasedRestoreDetails": {
"description": "IaaS VM workload specific restore details for restores using managed identity",
"type": "object",
"properties": {
"objectType": {
"description": "Gets the class type.",
"type": "string"
},
"targetStorageAccountId": {
"description": "Fully qualified ARM ID of the target storage account.",
"type": "string"
}
}
},
"IdentityInfo": {
"description": "Encapsulates Managed Identity related information",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"azureRegion": "southeastasia",
"api-version": "2018-12-20",
"parameters": {
"crossRegionRestoreAccessDetails": {
"accessTokenString": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkhqaUJHdVExa2lWV2hyc2lzLUhEckhyWVZNbyJ9.eyJVc2VySWRlbnRpdHlUeXBlIjoiQUFEIiwiQWFkVGVuYW50SWQiOiIzM2UwMTkyMS00ZDY0LTRmOGMtYTA1NS01YmRhZmZkNWUzM2QiLCJBYWRTUE9iamVjdElkIjoiOTMzMjc2ZmMtMWJiNy00ZWNiLTk0ZTYtYWY3ODMyNWY3MjZhIiwiUmVzdG9yZVBvaW50UGVybWlzc2lvbnMiOiJSZWFkIiwiUmVzdG9yZVBvaW50SUQiOiJyZXNvdXJjZXMvMTMzMDgzNzkwNjQxODEzODE2MC9wcm90ZWN0aW9uQ29udGFpbmVycy8xMTE0Ni9wcm90ZWN0ZWRJdGVtcy8xMTQyOTM3MDMxL3JlY292ZXJ5UG9pbnRzLzg3MTc4MzU1MzkyNzE2IiwiaXNzIjoiaHR0cHM6Ly9SZWNvdmVyeVNlcnZpY2UiLCJhdWQiOiJodHRwczovL1JlY292ZXJ5U2VydmljZXMvUHJvdGVjdGlvblNlcnZpY2UiLCJleHAiOjE1NzExMjE5ODYsIm5iZiI6MTU3MTAzNTI4Nn0.oNbeX8ueE6JRGU0IagFjkOlU-o48ez9gCeCrn1-8XEsaVtYJIFKq9FeHfPAoCMxiLQvwL7S0JTjDTjiEsZEvr_VM7tDVwW3sESo2oW-SZlxT_1dJiUBn0jVlQyfDcHEMzbkaTuZswgNWfowgOrnJ67y-ztSUcegf3eVKPEhN1enBBS7pIuL9bZ3SVwMuqznUen6dH54y9lN2w6H14X0UK2CwSN94Uh-spB27j9SbksxLY_tyZm6xsamZFTHpwbgZwR24-GDtElPSxpFL6n_tWLSCHQtN9s84o0X7PfFaMkVmGWbOf4AZmP9M6agagG0JLnlOwObr07YrzZRkg3s2eQ",
"backupManagementType": "AzureIaasVM",
"containerName": "iaasvmcontainerv2;srinivasccyrg;sriniccylinux",
"containerType": "IaasVMContainer",
"coordinatorServiceStampUri": "https://pod01-coord1.ccy.backup.windowsazure.com",
"datasourceContainerName": "iaasvmcontainerv2;srinivasccyrg;sriniccylinux",
"datasourceId": "1142937031",
"datasourceName": "sriniccylinux",
"datasourceType": "VM",
"protectionServiceStampId": "90d98224-2ac6-4bda-9f35-33fb22841f2a",
"protectionServiceStampUri": "https://pod01-prot1-int.ccy.backup.windowsazure.com",
"recoveryPointId": "87178355392716",
"recoveryPointTime": "10/9/2019 6:05:54 PM",
"resourceGroupName": "srinivasccyrg",
"resourceId": "1330837906418138160",
"resourceName": "sriniccyvault",
"subscriptionId": "f2edfd5d-5496-4683-b94f-b3588c579009",
"tokenExtendedInformation": "<IaaSVMRecoveryPointMetadataBase xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" i:type=\"IaaSVMRecoveryPointMetadata_V2015_09\" xmlns=\"http://windowscloudbackup.com/CloudCommon/V2011_09\"><MetadataVersion>V2015_09</MetadataVersion><ContainerType i:nil=\"true\" /><InstantRpGCId>f2edfd5d-5496-4683-b94f-b3588c579009;AzureBackup_sriniccylinux_1142937031;AzureBackup_20191009_060554;AzureBackupRG_centraluseuap_1</InstantRpGCId><IsBlockBlobEnabled>true</IsBlockBlobEnabled><IsManagedVirtualMachine>true</IsManagedVirtualMachine><OriginalSAOption>false</OriginalSAOption><OsType>Linux</OsType><ReadMetadaFromConfigBlob i:nil=\"true\" /><RecoveryPointConsistencyType>FileSystemConsistent</RecoveryPointConsistencyType><RpDiskDetails i:nil=\"true\" /><SourceIaaSVMRPKeyAndSecret i:nil=\"true\" /><SourceIaaSVMStorageType>PremiumVMOnPremiumStorage</SourceIaaSVMStorageType><VMSizeDescription>Standard_D2s_v3</VMSizeDescription></IaaSVMRecoveryPointMetadataBase>"
},
"restoreRequest": {
"affinityGroup": "",
"createNewCloudService": false,
"encryptionDetails": {
"encryptionEnabled": false
},
"identityInfo": {
"isSystemAssignedIdentity": false,
"managedIdentityResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"
},
"identityBasedRestoreDetails": {
"targetStorageAccountId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00prjaiTestRg1/providers/Microsoft.Storage/storageAccounts/00prjaitestrg1disks993"
},
"objectType": "IaasVMRestoreRequest",
"originalStorageAccountOption": false,
"recoveryPointId": "87178355392716",
"recoveryType": "AlternateLocation",
"region": "eastus2euap",
"sourceResourceId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/srinivasccyrg/providers/Microsoft.Compute/virtualMachines/sriniccylinux",
"subnetId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAcklVaultCCY/providers/Microsoft.Network/virtualNetworks/00networkAcklVaultCCY-vnet/subnets/default",
"targetDomainNameId": null,
"targetResourceGroupId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAckl",
"targetVirtualMachineId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAckl/providers/Microsoft.Compute/virtualMachines/gaallaVM",
"virtualNetworkId": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/00networkAcklVaultCCY/providers/Microsoft.Network/virtualNetworks/00networkAcklVaultCCY-vnet",
"zones": [
"2"
]
}
}
},
"responses": {
"200": {},
"202": {
"headers": {
"Location": "location: https://centraluseuap.management.azure.com/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/providers/microsoft.recoveryservices/locations/eastus2euap/backupCrrOperationResults/MTMzMDgzNzkwNjQxODEzODE2MDtkMTY3MzM3Yy0yM2I1LTQ5ODgtODkwZC0xY2MyMmQ5MTYyZjA=?api-version=2018-12-20-preview",
"Azure-AsyncOperation": "azure-asyncoperation: https://centraluseuap.management.azure.com/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/providers/microsoft.recoveryservices/locations/eastus2euap/backupCrrOperationsStatus/MTMzMDgzNzkwNjQxODEzODE2MDtkMTY3MzM3Yy0yM2I1LTQ5ODgtODkwZC0xY2MyMmQ5MTYyZjA=?api-version=2018-12-20-preview",
"Retry-After": 60
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1823,12 +1823,18 @@
"Restore to New Azure IaasVm with IaasVMRestoreRequest": {
"$ref": "./examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest.json"
},
"Restore to New Azure IaasVm with IaasVMRestoreRequest with identityBasedRestoreDetails": {
"$ref": "./examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json"
},
"Restore to New Azure IaasVm with IaasVMRestoreWithRehydrationRequest": {
"$ref": "./examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreWithRehydrationRequest.json"
},
"Restore Disks with IaasVMRestoreRequest": {
"$ref": "./examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest.json"
},
"Restore Disks with IaasVMRestoreRequest with IdentityBasedRestoreDetails": {
"$ref": "./examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json"
},
"Restore Disks with IaasVMRestoreWithRehydrationRequest": {
"$ref": "./examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreWithRehydrationRequest.json"
}
Expand Down Expand Up @@ -2577,6 +2583,9 @@
"x-ms-examples": {
"Validate Operation": {
"$ref": "./examples/AzureIaasVm/ValidateOperation_RestoreDisk.json"
},
"Validate Operation with identityBasedRestoreDetails": {
"$ref": "./examples/AzureIaasVm/ValidateOperation_RestoreDisk_IdentityBasedRestoreDetails.json"
}
}
}
Expand Down Expand Up @@ -6647,6 +6656,20 @@
},
"x-ms-discriminator-value": "GenericProtectionPolicy"
},
"IdentityBasedRestoreDetails": {
"description": "IaaS VM workload specific restore details for restores using managed identity",
"type": "object",
"properties": {
"objectType": {
"description": "Gets the class type.",
"type": "string"
},
"targetStorageAccountId": {
"description": "Fully qualified ARM ID of the target storage account.",
"type": "string"
}
}
},
"IdentityInfo": {
"description": "Encapsulates Managed Identity related information",
"type": "object",
Expand Down Expand Up @@ -6947,6 +6970,10 @@
"identityInfo": {
"$ref": "#/definitions/IdentityInfo",
"description": "Managed Identity information required to access customer storage account."
},
"identityBasedRestoreDetails": {
"$ref": "#/definitions/IdentityBasedRestoreDetails",
"description": "IaaS VM workload specific restore details for restores using managed identity."
}
},
"x-ms-discriminator-value": "IaasVMRestoreRequest"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "netsdktestrg",
"vaultName": "testVault",
"fabricName": "Azure",
"containerName": "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1",
"protectedItemName": "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1",
"recoveryPointId": "348916168024334",
"api-version": "2021-07-01",
"parameters": {
"properties": {
"objectType": "IaasVMRestoreRequest",
"recoveryPointId": "348916168024334",
"recoveryType": "AlternateLocation",
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1",
"targetVirtualMachineId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2/providers/Microsoft.Compute/virtualmachines/RSMDALRVM981435",
"targetResourceGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2",
"virtualNetworkId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet",
"subnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet/subnets/default",
"region": "southeastasia",
"createNewCloudService": false,
"originalStorageAccountOption": false,
"encryptionDetails": {
"encryptionEnabled": false
},
"identityInfo": {
"isSystemAssignedIdentity": true
},
"identityBasedRestoreDetails": {
"targetStorageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Storage/storageAccounts/testingAccount"
}
}
}
},
"responses": {
"202": {
"headers": {
"Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.RecoveryServices/vaults/testVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1/protectedItems/vm;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1/operationResults/00000000-0000-0000-0000-000000000000?api-version=2017-07-01",
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.RecoveryServices/vaults/testVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1/protectedItems/vm;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1/operationsStatus/00000000-0000-0000-0000-000000000000?api-version=2017-07-01",
"Retry-After": 60
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "netsdktestrg",
"vaultName": "testVault",
"fabricName": "Azure",
"containerName": "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1",
"protectedItemName": "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1",
"recoveryPointId": "348916168024334",
"api-version": "2021-07-01",
"parameters": {
"properties": {
"objectType": "IaasVMRestoreRequest",
"recoveryPointId": "348916168024334",
"recoveryType": "RestoreDisks",
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1",
"region": "southeastasia",
"createNewCloudService": true,
"originalStorageAccountOption": false,
"encryptionDetails": {
"encryptionEnabled": false
},
"identityInfo": {
"isSystemAssignedIdentity": false,
"managedIdentityResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"
},
"identityBasedRestoreDetails": {
"targetStorageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"
}
}
}
},
"responses": {
"202": {
"headers": {
"Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.RecoveryServices/vaults/testVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasVMContainerV2;netsdktestrg;netvmtestv2vm1/protectedItems/vm;iaasVMContainerV2;netsdktestrg;netvmtestv2vm1/operationResults/00000000-0000-0000-0000-000000000000?api-version=2020-09-01",
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.RecoveryServices/vaults/testVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasVMContainerV2;netsdktestrg;netvmtestv2vm1/protectedItems/vm;iaasVMContainerV2;netsdktestrg;netvmtestv2vm1/operationsStatus/00000000-0000-0000-0000-000000000000?api-version=2020-09-01",
"Retry-After": 60
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"parameters": {
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "testRG",
"vaultName": "testVault",
"fabricName": "Azure",
"containerName": "IaasVMContainer;iaasvmcontainerv2;testRG;testvmName",
"protectedItemName": "VM;iaasvmcontainerv2;testRG;testvmName",
"recoveryPointId": "348916168024334",
"api-version": "2021-07-01",
"parameters": {
"objectType": "ValidateIaasVMRestoreOperationRequest",
"restoreRequest": {
"recoveryPointId": "348916168024334",
"objectType": "IaasVMRestoreRequest",
"recoveryType": "RestoreDisks",
"sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1",
"region": "southeastasia",
"createNewCloudService": true,
"originalStorageAccountOption": false,
"encryptionDetails": {
"encryptionEnabled": false
},
"identityInfo": {
"isSystemAssignedIdentity": false,
"managedIdentityResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"
},
"identityBasedRestoreDetails": {
"targetStorageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"
}
}
}
},
"responses": {
"200": {
"headers": {},
"body": {
"validateOperationResponse": {
"validationResults": [
{
"code": "UserErrorCoreCountSubscriptionQuotaReached",
"message": "Core Count subscription quota has been reached.",
"recommendations": [
"Contact Azure support to increase the limits."
]
}
]
}
}
}
}
}

0 comments on commit 39fa4ce

Please sign in to comment.