diff --git a/src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/IaasVm/PolicyTests.cs b/src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/IaasVm/PolicyTests.cs index 37767eb765bc..81efc022b762 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/IaasVm/PolicyTests.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/IaasVm/PolicyTests.cs @@ -88,5 +88,17 @@ public void TestAzureVMCrashconsistentPolicy() "Test-AzureVMCrashconsistentPolicy" ); } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + [Trait(TestConstants.Workload, TestConstants.AzureVM)] + public void TestAzureVMEnhancedPolicyAsDefaultPolicy() + { + TestRunner.RunTestScript( + $"Import-Module {_IaasVmcommonModule.AsAbsoluteLocation()}", + $"Import-Module {_IaasVmtestModule.AsAbsoluteLocation()}", + "Test-AzureVMEnhancedPolicyAsDefault" + ); + } } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/IaasVm/PolicyTests.ps1 b/src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/IaasVm/PolicyTests.ps1 index 03c9d1dfa058..db2990927f23 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/IaasVm/PolicyTests.ps1 +++ b/src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/IaasVm/PolicyTests.ps1 @@ -343,4 +343,54 @@ function Test-AzureVMPolicy # Cleanup Cleanup-ResourceGroup $resourceGroupName } +} + +function Test-AzureVMEnhancedPolicyAsDefault +{ + try + { + $resourceGroupName = "sgholapCZRTesting" + $vaultName = "sgholapZRSTestingVault" + $owner = "sgholap" + $AzureVMPolicyName = "AzureVMPolicy" + $AzureFilesPolicyName = "AzureFilesPolicy" + + $vault = Get-AzRecoveryServicesVault -ResourceGroupName $resourceGroupName -Name $vaultName + + $azureVMSchedulePolicy = Get-AzRecoveryServicesBackupSchedulePolicyObject -WorkloadType AzureVM -BackupManagementType AzureVM -ScheduleRunFrequency Weekly + Assert-NotNull $azureVMSchedulePolicy + + $azureVMRetentionPolicy = Get-AzRecoveryServicesBackupRetentionPolicyObject -WorkloadType AzureVM -BackupManagementType AzureVM -ScheduleRunFrequency Weekly + Assert-NotNull $azureVMRetentionPolicy + + $azureVMPolicy = New-AzRecoveryServicesBackupProtectionPolicy -Name $AzureVMPolicyName -WorkloadType AzureVM -BackupManagementType AzureVM -RetentionPolicy $azureVMRetentionPolicy -SchedulePolicy $azureVMSchedulePolicy -VaultId $vault.ID + + Assert-NotNull $azureVMPolicy + Assert-AreEqual $azureVMPolicy.Name $AzureVMPolicyName + # Default policy type for AzureVM should be Enhanced + Assert-AreEqual $azureVMPolicy.PolicySubType "Enhanced" + + $azureFilesSchedulePolicy = Get-AzRecoveryServicesBackupSchedulePolicyObject -WorkloadType AzureFiles + Assert-NotNull $azureVMSchedulePolicy + + $azureFilesRetentionPolicy = Get-AzRecoveryServicesBackupRetentionPolicyObject -WorkloadType AzureFiles + Assert-NotNull $azureVMRetentionPolicy + + $azureFilesPolicy = New-AzRecoveryServicesBackupProtectionPolicy -Name $AzureFilesPolicyName -WorkloadType AzureFiles -RetentionPolicy $azureFilesRetentionPolicy -SchedulePolicy $azureFilesSchedulePolicy -VaultId $vault.ID + + Assert-NotNull $azureFilesPolicy + Assert-AreEqual $azureFilesPolicy.Name $AzureFilesPolicyName + # Default policy type for AzureFiles should be Standard + Assert-AreNotEqual $azureFilesPolicy.PolicySubType "Enhanced" + } + finally + { + # Cleanup + # Delete policy + $policy = Get-AzRecoveryServicesBackupProtectionPolicy -VaultId $vault.ID -Name $AzureVMPolicyName + Remove-AzRecoveryServicesBackupProtectionPolicy -VaultId $vault.ID -Policy $policy -Force + + $policy = Get-AzRecoveryServicesBackupProtectionPolicy -VaultId $vault.ID -Name $AzureFilesPolicyName + Remove-AzRecoveryServicesBackupProtectionPolicy -VaultId $vault.ID -Policy $policy -Force + } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Test/SessionRecords/Microsoft.Azure.Commands.RecoveryServices.Backup.Test.ScenarioTests.PolicyTests/TestAzureVMEnhancedPolicyAsDefaultPolicy.json b/src/RecoveryServices/RecoveryServices.Backup.Test/SessionRecords/Microsoft.Azure.Commands.RecoveryServices.Backup.Test.ScenarioTests.PolicyTests/TestAzureVMEnhancedPolicyAsDefaultPolicy.json new file mode 100644 index 000000000000..67fc6077254c --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Test/SessionRecords/Microsoft.Azure.Commands.RecoveryServices.Backup.Test.ScenarioTests.PolicyTests/TestAzureVMEnhancedPolicyAsDefaultPolicy.json @@ -0,0 +1,788 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault?api-version=2024-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjJlZGZkNWQtNTQ5Ni00NjgzLWI5NGYtYjM1ODhjNTc5MDA5L3Jlc291cmNlR3JvdXBzL3NnaG9sYXBDWlJUZXN0aW5nL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy92YXVsdHMvc2dob2xhcFpSU1Rlc3RpbmdWYXVsdD9hcGktdmVyc2lvbj0yMDI0LTA0LTAx", + "RequestMethod": "GET", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c5c5de4d-98bf-43be-91dc-70faf2e7cb46" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/6.0.3624.51421", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/7.4.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "1099" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "e540975c-a3f7-49d7-91ba-852cb417533d" + ], + "x-ms-client-request-id": [ + "c5c5de4d-98bf-43be-91dc-70faf2e7cb46" + ], + "x-ms-ratelimit-remaining-subscription-global-reads": [ + "16499" + ], + "x-ms-correlation-request-id": [ + "e540975c-a3f7-49d7-91ba-852cb417533d" + ], + "x-ms-routing-request-id": [ + "CENTRALINDIA:20250123T175534Z:e540975c-a3f7-49d7-91ba-852cb417533d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 9E8C03BAED6B4ACAA23729D72D732EA6 Ref B: MAA201060515051 Ref C: 2025-01-23T17:55:33Z" + ], + "Date": [ + "Thu, 23 Jan 2025 17:55:33 GMT" + ], + "Content-Length": [ + "1021" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"location\": \"eastus2euap\",\r\n \"name\": \"sgholapZRSTestingVault\",\r\n \"etag\": \"W/\\\"datetime'2024-11-27T12%3A58%3A42.7045328Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"privateEndpointStateForBackup\": \"None\",\r\n \"privateEndpointStateForSiteRecovery\": \"None\",\r\n \"backupStorageVersion\": \"V1\",\r\n \"securitySettings\": {\r\n \"immutabilitySettings\": {\r\n \"state\": \"Disabled\"\r\n },\r\n \"softDeleteSettings\": {\r\n \"softDeleteRetentionPeriodInDays\": 14,\r\n \"softDeleteState\": \"Enabled\",\r\n \"enhancedSecurityState\": \"Enabled\"\r\n },\r\n \"multiUserAuthorization\": \"Disabled\"\r\n },\r\n \"redundancySettings\": {\r\n \"standardTierStorageRedundancy\": \"ZoneRedundant\",\r\n \"crossRegionRestore\": \"Disabled\"\r\n },\r\n \"secureScore\": \"None\",\r\n \"bcdrSecurityLevel\": \"Poor\",\r\n \"publicNetworkAccess\": \"Enabled\",\r\n \"restoreSettings\": {\r\n \"crossSubscriptionRestoreSettings\": {\r\n \"crossSubscriptionRestoreState\": \"Enabled\"\r\n }\r\n }\r\n },\r\n \"id\": \"/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"RS0\",\r\n \"tier\": \"Standard\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault/backupPolicies/AzureVMPolicy?api-version=2024-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjJlZGZkNWQtNTQ5Ni00NjgzLWI5NGYtYjM1ODhjNTc5MDA5L3Jlc291cmNlR3JvdXBzL3NnaG9sYXBDWlJUZXN0aW5nL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy92YXVsdHMvc2dob2xhcFpSU1Rlc3RpbmdWYXVsdC9iYWNrdXBQb2xpY2llcy9BenVyZVZNUG9saWN5P2FwaS12ZXJzaW9uPTIwMjQtMDQtMDE=", + "RequestMethod": "GET", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e55ec699-59a4-4e7d-909a-8913c0df0fbc" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/6.0.3624.51421", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.Backup.RecoveryServicesBackupClient/7.4.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "149" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "835e3b69-e234-4482-926b-9e6519cc7797" + ], + "x-ms-client-request-id": [ + "e55ec699-59a4-4e7d-909a-8913c0df0fbc" + ], + "x-ms-correlation-request-id": [ + "835e3b69-e234-4482-926b-9e6519cc7797" + ], + "x-ms-routing-request-id": [ + "CENTRALINDIA:20250123T175535Z:835e3b69-e234-4482-926b-9e6519cc7797" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: F666BD942DB740A9988CD9FB861602BF Ref B: MAA201060515035 Ref C: 2025-01-23T17:55:34Z" + ], + "Date": [ + "Thu, 23 Jan 2025 17:55:35 GMT" + ], + "Content-Length": [ + "2" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{}", + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault/backupPolicies/AzureVMPolicy?api-version=2024-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjJlZGZkNWQtNTQ5Ni00NjgzLWI5NGYtYjM1ODhjNTc5MDA5L3Jlc291cmNlR3JvdXBzL3NnaG9sYXBDWlJUZXN0aW5nL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy92YXVsdHMvc2dob2xhcFpSU1Rlc3RpbmdWYXVsdC9iYWNrdXBQb2xpY2llcy9BenVyZVZNUG9saWN5P2FwaS12ZXJzaW9uPTIwMjQtMDQtMDE=", + "RequestMethod": "GET", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e55ec699-59a4-4e7d-909a-8913c0df0fbc" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/6.0.3624.51421", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.Backup.RecoveryServicesBackupClient/7.4.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "330943ba-7498-43b6-af68-d60a00c87571" + ], + "x-ms-client-request-id": [ + "e55ec699-59a4-4e7d-909a-8913c0df0fbc" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "149" + ], + "x-ms-correlation-request-id": [ + "330943ba-7498-43b6-af68-d60a00c87571" + ], + "x-ms-routing-request-id": [ + "CENTRALINDIA:20250123T175539Z:330943ba-7498-43b6-af68-d60a00c87571" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 7504F921CFBB42DCB13B011E10BD8D8D Ref B: MAA201060515035 Ref C: 2025-01-23T17:55:38Z" + ], + "Date": [ + "Thu, 23 Jan 2025 17:55:38 GMT" + ], + "Content-Length": [ + "1443" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault/backupPolicies/AzureVMPolicy\",\r\n \"name\": \"AzureVMPolicy\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults/backupPolicies\",\r\n \"properties\": {\r\n \"backupManagementType\": \"AzureIaasVM\",\r\n \"policyType\": \"V2\",\r\n \"instantRPDetails\": {},\r\n \"schedulePolicy\": {\r\n \"schedulePolicyType\": \"SimpleSchedulePolicyV2\",\r\n \"scheduleRunFrequency\": \"Weekly\",\r\n \"weeklySchedule\": {\r\n \"scheduleRunDays\": [\r\n \"Sunday\"\r\n ],\r\n \"scheduleRunTimes\": [\r\n \"2025-01-23T07:30:00Z\"\r\n ]\r\n }\r\n },\r\n \"retentionPolicy\": {\r\n \"retentionPolicyType\": \"LongTermRetentionPolicy\",\r\n \"weeklySchedule\": {\r\n \"daysOfTheWeek\": [\r\n \"Sunday\"\r\n ],\r\n \"retentionTimes\": [\r\n \"2025-01-23T07:30:00Z\"\r\n ],\r\n \"retentionDuration\": {\r\n \"count\": 104,\r\n \"durationType\": \"Weeks\"\r\n }\r\n },\r\n \"monthlySchedule\": {\r\n \"retentionScheduleFormatType\": \"Weekly\",\r\n \"retentionScheduleWeekly\": {\r\n \"daysOfTheWeek\": [\r\n \"Sunday\"\r\n ],\r\n \"weeksOfTheMonth\": [\r\n \"First\"\r\n ]\r\n },\r\n \"retentionTimes\": [\r\n \"2025-01-23T07:30:00Z\"\r\n ],\r\n \"retentionDuration\": {\r\n \"count\": 60,\r\n \"durationType\": \"Months\"\r\n }\r\n },\r\n \"yearlySchedule\": {\r\n \"retentionScheduleFormatType\": \"Weekly\",\r\n \"monthsOfYear\": [\r\n \"January\"\r\n ],\r\n \"retentionScheduleWeekly\": {\r\n \"daysOfTheWeek\": [\r\n \"Sunday\"\r\n ],\r\n \"weeksOfTheMonth\": [\r\n \"First\"\r\n ]\r\n },\r\n \"retentionTimes\": [\r\n \"2025-01-23T07:30:00Z\"\r\n ],\r\n \"retentionDuration\": {\r\n \"count\": 10,\r\n \"durationType\": \"Years\"\r\n }\r\n }\r\n },\r\n \"tieringPolicy\": {\r\n \"ArchivedRP\": {\r\n \"tieringMode\": \"DoNotTier\",\r\n \"duration\": 0,\r\n \"durationType\": \"Invalid\"\r\n }\r\n },\r\n \"instantRpRetentionRangeInDays\": 7,\r\n \"timeZone\": \"UTC\",\r\n \"protectedItemsCount\": 0\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault/backupPolicies/AzureVMPolicy?api-version=2024-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjJlZGZkNWQtNTQ5Ni00NjgzLWI5NGYtYjM1ODhjNTc5MDA5L3Jlc291cmNlR3JvdXBzL3NnaG9sYXBDWlJUZXN0aW5nL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy92YXVsdHMvc2dob2xhcFpSU1Rlc3RpbmdWYXVsdC9iYWNrdXBQb2xpY2llcy9BenVyZVZNUG9saWN5P2FwaS12ZXJzaW9uPTIwMjQtMDQtMDE=", + "RequestMethod": "GET", + "RequestHeaders": { + "x-ms-client-request-id": [ + "3388c062-e840-4159-833c-f8d68956d95d" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/6.0.3624.51421", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.Backup.RecoveryServicesBackupClient/7.4.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "3f2ad2c6-de67-4cd1-83aa-26bc99927d2f" + ], + "x-ms-client-request-id": [ + "3388c062-e840-4159-833c-f8d68956d95d" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "149" + ], + "x-ms-correlation-request-id": [ + "3f2ad2c6-de67-4cd1-83aa-26bc99927d2f" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20250123T175544Z:3f2ad2c6-de67-4cd1-83aa-26bc99927d2f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: CF5761E711994D4089B1A0AAD6ABF0D1 Ref B: MAA201060514009 Ref C: 2025-01-23T17:55:43Z" + ], + "Date": [ + "Thu, 23 Jan 2025 17:55:44 GMT" + ], + "Content-Length": [ + "1443" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault/backupPolicies/AzureVMPolicy\",\r\n \"name\": \"AzureVMPolicy\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults/backupPolicies\",\r\n \"properties\": {\r\n \"backupManagementType\": \"AzureIaasVM\",\r\n \"policyType\": \"V2\",\r\n \"instantRPDetails\": {},\r\n \"schedulePolicy\": {\r\n \"schedulePolicyType\": \"SimpleSchedulePolicyV2\",\r\n \"scheduleRunFrequency\": \"Weekly\",\r\n \"weeklySchedule\": {\r\n \"scheduleRunDays\": [\r\n \"Sunday\"\r\n ],\r\n \"scheduleRunTimes\": [\r\n \"2025-01-23T07:30:00Z\"\r\n ]\r\n }\r\n },\r\n \"retentionPolicy\": {\r\n \"retentionPolicyType\": \"LongTermRetentionPolicy\",\r\n \"weeklySchedule\": {\r\n \"daysOfTheWeek\": [\r\n \"Sunday\"\r\n ],\r\n \"retentionTimes\": [\r\n \"2025-01-23T07:30:00Z\"\r\n ],\r\n \"retentionDuration\": {\r\n \"count\": 104,\r\n \"durationType\": \"Weeks\"\r\n }\r\n },\r\n \"monthlySchedule\": {\r\n \"retentionScheduleFormatType\": \"Weekly\",\r\n \"retentionScheduleWeekly\": {\r\n \"daysOfTheWeek\": [\r\n \"Sunday\"\r\n ],\r\n \"weeksOfTheMonth\": [\r\n \"First\"\r\n ]\r\n },\r\n \"retentionTimes\": [\r\n \"2025-01-23T07:30:00Z\"\r\n ],\r\n \"retentionDuration\": {\r\n \"count\": 60,\r\n \"durationType\": \"Months\"\r\n }\r\n },\r\n \"yearlySchedule\": {\r\n \"retentionScheduleFormatType\": \"Weekly\",\r\n \"monthsOfYear\": [\r\n \"January\"\r\n ],\r\n \"retentionScheduleWeekly\": {\r\n \"daysOfTheWeek\": [\r\n \"Sunday\"\r\n ],\r\n \"weeksOfTheMonth\": [\r\n \"First\"\r\n ]\r\n },\r\n \"retentionTimes\": [\r\n \"2025-01-23T07:30:00Z\"\r\n ],\r\n \"retentionDuration\": {\r\n \"count\": 10,\r\n \"durationType\": \"Years\"\r\n }\r\n }\r\n },\r\n \"tieringPolicy\": {\r\n \"ArchivedRP\": {\r\n \"tieringMode\": \"DoNotTier\",\r\n \"duration\": 0,\r\n \"durationType\": \"Invalid\"\r\n }\r\n },\r\n \"instantRpRetentionRangeInDays\": 7,\r\n \"timeZone\": \"UTC\",\r\n \"protectedItemsCount\": 0\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault/backupPolicies/AzureVMPolicy?api-version=2024-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjJlZGZkNWQtNTQ5Ni00NjgzLWI5NGYtYjM1ODhjNTc5MDA5L3Jlc291cmNlR3JvdXBzL3NnaG9sYXBDWlJUZXN0aW5nL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy92YXVsdHMvc2dob2xhcFpSU1Rlc3RpbmdWYXVsdC9iYWNrdXBQb2xpY2llcy9BenVyZVZNUG9saWN5P2FwaS12ZXJzaW9uPTIwMjQtMDQtMDE=", + "RequestMethod": "PUT", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e55ec699-59a4-4e7d-909a-8913c0df0fbc" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/6.0.3624.51421", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.Backup.RecoveryServicesBackupClient/7.4.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "1883" + ] + }, + "RequestBody": "{\r\n \"properties\": {\r\n \"backupManagementType\": \"AzureIaasVM\",\r\n \"schedulePolicy\": {\r\n \"schedulePolicyType\": \"SimpleSchedulePolicyV2\",\r\n \"scheduleRunFrequency\": \"Weekly\",\r\n \"weeklySchedule\": {\r\n \"scheduleRunDays\": [\r\n \"Sunday\"\r\n ],\r\n \"scheduleRunTimes\": [\r\n \"2025-01-23T07:30:00Z\"\r\n ]\r\n }\r\n },\r\n \"retentionPolicy\": {\r\n \"retentionPolicyType\": \"LongTermRetentionPolicy\",\r\n \"weeklySchedule\": {\r\n \"daysOfTheWeek\": [\r\n \"Sunday\"\r\n ],\r\n \"retentionTimes\": [\r\n \"2025-01-23T07:30:00Z\"\r\n ],\r\n \"retentionDuration\": {\r\n \"count\": 104,\r\n \"durationType\": \"Weeks\"\r\n }\r\n },\r\n \"monthlySchedule\": {\r\n \"retentionScheduleFormatType\": \"Weekly\",\r\n \"retentionScheduleWeekly\": {\r\n \"daysOfTheWeek\": [\r\n \"Sunday\"\r\n ],\r\n \"weeksOfTheMonth\": [\r\n \"First\"\r\n ]\r\n },\r\n \"retentionTimes\": [\r\n \"2025-01-23T07:30:00Z\"\r\n ],\r\n \"retentionDuration\": {\r\n \"count\": 60,\r\n \"durationType\": \"Months\"\r\n }\r\n },\r\n \"yearlySchedule\": {\r\n \"retentionScheduleFormatType\": \"Weekly\",\r\n \"monthsOfYear\": [\r\n \"January\"\r\n ],\r\n \"retentionScheduleWeekly\": {\r\n \"daysOfTheWeek\": [\r\n \"Sunday\"\r\n ],\r\n \"weeksOfTheMonth\": [\r\n \"First\"\r\n ]\r\n },\r\n \"retentionTimes\": [\r\n \"2025-01-23T07:30:00Z\"\r\n ],\r\n \"retentionDuration\": {\r\n \"count\": 10,\r\n \"durationType\": \"Years\"\r\n }\r\n }\r\n },\r\n \"tieringPolicy\": {\r\n \"ArchivedRP\": {\r\n \"tieringMode\": \"DoNotTier\"\r\n }\r\n },\r\n \"instantRpRetentionRangeInDays\": 7,\r\n \"timeZone\": \"UTC\",\r\n \"policyType\": \"V2\"\r\n }\r\n}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "361767b4-ccbe-4b26-940f-68f9f990c2a1" + ], + "x-ms-client-request-id": [ + "e55ec699-59a4-4e7d-909a-8913c0df0fbc" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "799" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "361767b4-ccbe-4b26-940f-68f9f990c2a1" + ], + "x-ms-routing-request-id": [ + "CENTRALINDIA:20250123T175538Z:361767b4-ccbe-4b26-940f-68f9f990c2a1" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 7D3F9B0592C148F298305D7D60C630DD Ref B: MAA201060515035 Ref C: 2025-01-23T17:55:35Z" + ], + "Date": [ + "Thu, 23 Jan 2025 17:55:37 GMT" + ], + "Content-Length": [ + "1443" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault/backupPolicies/AzureVMPolicy\",\r\n \"name\": \"AzureVMPolicy\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults/backupPolicies\",\r\n \"properties\": {\r\n \"backupManagementType\": \"AzureIaasVM\",\r\n \"policyType\": \"V2\",\r\n \"instantRPDetails\": {},\r\n \"schedulePolicy\": {\r\n \"schedulePolicyType\": \"SimpleSchedulePolicyV2\",\r\n \"scheduleRunFrequency\": \"Weekly\",\r\n \"weeklySchedule\": {\r\n \"scheduleRunDays\": [\r\n \"Sunday\"\r\n ],\r\n \"scheduleRunTimes\": [\r\n \"2025-01-23T07:30:00Z\"\r\n ]\r\n }\r\n },\r\n \"retentionPolicy\": {\r\n \"retentionPolicyType\": \"LongTermRetentionPolicy\",\r\n \"weeklySchedule\": {\r\n \"daysOfTheWeek\": [\r\n \"Sunday\"\r\n ],\r\n \"retentionTimes\": [\r\n \"2025-01-23T07:30:00Z\"\r\n ],\r\n \"retentionDuration\": {\r\n \"count\": 104,\r\n \"durationType\": \"Weeks\"\r\n }\r\n },\r\n \"monthlySchedule\": {\r\n \"retentionScheduleFormatType\": \"Weekly\",\r\n \"retentionScheduleWeekly\": {\r\n \"daysOfTheWeek\": [\r\n \"Sunday\"\r\n ],\r\n \"weeksOfTheMonth\": [\r\n \"First\"\r\n ]\r\n },\r\n \"retentionTimes\": [\r\n \"2025-01-23T07:30:00Z\"\r\n ],\r\n \"retentionDuration\": {\r\n \"count\": 60,\r\n \"durationType\": \"Months\"\r\n }\r\n },\r\n \"yearlySchedule\": {\r\n \"retentionScheduleFormatType\": \"Weekly\",\r\n \"monthsOfYear\": [\r\n \"January\"\r\n ],\r\n \"retentionScheduleWeekly\": {\r\n \"daysOfTheWeek\": [\r\n \"Sunday\"\r\n ],\r\n \"weeksOfTheMonth\": [\r\n \"First\"\r\n ]\r\n },\r\n \"retentionTimes\": [\r\n \"2025-01-23T07:30:00Z\"\r\n ],\r\n \"retentionDuration\": {\r\n \"count\": 10,\r\n \"durationType\": \"Years\"\r\n }\r\n }\r\n },\r\n \"tieringPolicy\": {\r\n \"ArchivedRP\": {\r\n \"tieringMode\": \"DoNotTier\",\r\n \"duration\": 0,\r\n \"durationType\": \"Invalid\"\r\n }\r\n },\r\n \"instantRpRetentionRangeInDays\": 7,\r\n \"timeZone\": \"UTC\",\r\n \"protectedItemsCount\": 0\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault/backupPolicies/AzureFilesPolicy?api-version=2024-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjJlZGZkNWQtNTQ5Ni00NjgzLWI5NGYtYjM1ODhjNTc5MDA5L3Jlc291cmNlR3JvdXBzL3NnaG9sYXBDWlJUZXN0aW5nL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy92YXVsdHMvc2dob2xhcFpSU1Rlc3RpbmdWYXVsdC9iYWNrdXBQb2xpY2llcy9BenVyZUZpbGVzUG9saWN5P2FwaS12ZXJzaW9uPTIwMjQtMDQtMDE=", + "RequestMethod": "GET", + "RequestHeaders": { + "x-ms-client-request-id": [ + "51b52a0c-34b7-4c4c-80f5-f48b2ac7dd1d" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/6.0.3624.51421", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.Backup.RecoveryServicesBackupClient/7.4.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "149" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "588f4b51-b90f-464b-b23a-92c1e4a0a23b" + ], + "x-ms-client-request-id": [ + "51b52a0c-34b7-4c4c-80f5-f48b2ac7dd1d" + ], + "x-ms-correlation-request-id": [ + "588f4b51-b90f-464b-b23a-92c1e4a0a23b" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20250123T175540Z:588f4b51-b90f-464b-b23a-92c1e4a0a23b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: FA0F00C65ED2495C8BC0264E9DB80A7E Ref B: MAA201060513047 Ref C: 2025-01-23T17:55:39Z" + ], + "Date": [ + "Thu, 23 Jan 2025 17:55:40 GMT" + ], + "Content-Length": [ + "2" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{}", + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault/backupPolicies/AzureFilesPolicy?api-version=2024-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjJlZGZkNWQtNTQ5Ni00NjgzLWI5NGYtYjM1ODhjNTc5MDA5L3Jlc291cmNlR3JvdXBzL3NnaG9sYXBDWlJUZXN0aW5nL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy92YXVsdHMvc2dob2xhcFpSU1Rlc3RpbmdWYXVsdC9iYWNrdXBQb2xpY2llcy9BenVyZUZpbGVzUG9saWN5P2FwaS12ZXJzaW9uPTIwMjQtMDQtMDE=", + "RequestMethod": "GET", + "RequestHeaders": { + "x-ms-client-request-id": [ + "51b52a0c-34b7-4c4c-80f5-f48b2ac7dd1d" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/6.0.3624.51421", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.Backup.RecoveryServicesBackupClient/7.4.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "9cb2390b-c70d-4cda-9015-57a95761132d" + ], + "x-ms-client-request-id": [ + "51b52a0c-34b7-4c4c-80f5-f48b2ac7dd1d" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "149" + ], + "x-ms-correlation-request-id": [ + "9cb2390b-c70d-4cda-9015-57a95761132d" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20250123T175543Z:9cb2390b-c70d-4cda-9015-57a95761132d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 121FAF26720F4B708BB7D5616CE2D8ED Ref B: MAA201060513047 Ref C: 2025-01-23T17:55:42Z" + ], + "Date": [ + "Thu, 23 Jan 2025 17:55:43 GMT" + ], + "Content-Length": [ + "751" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault/backupPolicies/AzureFilesPolicy\",\r\n \"name\": \"AzureFilesPolicy\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults/backupPolicies\",\r\n \"properties\": {\r\n \"backupManagementType\": \"AzureStorage\",\r\n \"workLoadType\": \"AzureFileShare\",\r\n \"schedulePolicy\": {\r\n \"schedulePolicyType\": \"SimpleSchedulePolicy\",\r\n \"scheduleRunFrequency\": \"Daily\",\r\n \"scheduleRunTimes\": [\r\n \"2025-01-23T04:30:00Z\"\r\n ],\r\n \"scheduleWeeklyFrequency\": 0\r\n },\r\n \"retentionPolicy\": {\r\n \"retentionPolicyType\": \"LongTermRetentionPolicy\",\r\n \"dailySchedule\": {\r\n \"retentionTimes\": [\r\n \"2025-01-23T04:30:00Z\"\r\n ],\r\n \"retentionDuration\": {\r\n \"count\": 30,\r\n \"durationType\": \"Days\"\r\n }\r\n }\r\n },\r\n \"timeZone\": \"UTC\",\r\n \"protectedItemsCount\": 0\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault/backupPolicies/AzureFilesPolicy?api-version=2024-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjJlZGZkNWQtNTQ5Ni00NjgzLWI5NGYtYjM1ODhjNTc5MDA5L3Jlc291cmNlR3JvdXBzL3NnaG9sYXBDWlJUZXN0aW5nL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy92YXVsdHMvc2dob2xhcFpSU1Rlc3RpbmdWYXVsdC9iYWNrdXBQb2xpY2llcy9BenVyZUZpbGVzUG9saWN5P2FwaS12ZXJzaW9uPTIwMjQtMDQtMDE=", + "RequestMethod": "GET", + "RequestHeaders": { + "x-ms-client-request-id": [ + "ad69c3b1-bde7-4fc5-b64b-06cde9c59f95" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/6.0.3624.51421", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.Backup.RecoveryServicesBackupClient/7.4.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "79566dab-754a-4ad5-9974-7524416e3c30" + ], + "x-ms-client-request-id": [ + "ad69c3b1-bde7-4fc5-b64b-06cde9c59f95" + ], + "x-ms-ratelimit-remaining-subscription-resource-requests": [ + "149" + ], + "x-ms-correlation-request-id": [ + "79566dab-754a-4ad5-9974-7524416e3c30" + ], + "x-ms-routing-request-id": [ + "CENTRALINDIA:20250123T175547Z:79566dab-754a-4ad5-9974-7524416e3c30" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 42F63E9E71FF46F2AF7E8E43494AB2AF Ref B: MAA201060516017 Ref C: 2025-01-23T17:55:46Z" + ], + "Date": [ + "Thu, 23 Jan 2025 17:55:46 GMT" + ], + "Content-Length": [ + "751" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault/backupPolicies/AzureFilesPolicy\",\r\n \"name\": \"AzureFilesPolicy\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults/backupPolicies\",\r\n \"properties\": {\r\n \"backupManagementType\": \"AzureStorage\",\r\n \"workLoadType\": \"AzureFileShare\",\r\n \"schedulePolicy\": {\r\n \"schedulePolicyType\": \"SimpleSchedulePolicy\",\r\n \"scheduleRunFrequency\": \"Daily\",\r\n \"scheduleRunTimes\": [\r\n \"2025-01-23T04:30:00Z\"\r\n ],\r\n \"scheduleWeeklyFrequency\": 0\r\n },\r\n \"retentionPolicy\": {\r\n \"retentionPolicyType\": \"LongTermRetentionPolicy\",\r\n \"dailySchedule\": {\r\n \"retentionTimes\": [\r\n \"2025-01-23T04:30:00Z\"\r\n ],\r\n \"retentionDuration\": {\r\n \"count\": 30,\r\n \"durationType\": \"Days\"\r\n }\r\n }\r\n },\r\n \"timeZone\": \"UTC\",\r\n \"protectedItemsCount\": 0\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault/backupPolicies/AzureFilesPolicy?api-version=2024-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjJlZGZkNWQtNTQ5Ni00NjgzLWI5NGYtYjM1ODhjNTc5MDA5L3Jlc291cmNlR3JvdXBzL3NnaG9sYXBDWlJUZXN0aW5nL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy92YXVsdHMvc2dob2xhcFpSU1Rlc3RpbmdWYXVsdC9iYWNrdXBQb2xpY2llcy9BenVyZUZpbGVzUG9saWN5P2FwaS12ZXJzaW9uPTIwMjQtMDQtMDE=", + "RequestMethod": "PUT", + "RequestHeaders": { + "x-ms-client-request-id": [ + "51b52a0c-34b7-4c4c-80f5-f48b2ac7dd1d" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/6.0.3624.51421", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.Backup.RecoveryServicesBackupClient/7.4.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "633" + ] + }, + "RequestBody": "{\r\n \"properties\": {\r\n \"backupManagementType\": \"AzureStorage\",\r\n \"workLoadType\": \"AzureFileShare\",\r\n \"schedulePolicy\": {\r\n \"schedulePolicyType\": \"SimpleSchedulePolicy\",\r\n \"scheduleRunFrequency\": \"Daily\",\r\n \"scheduleRunTimes\": [\r\n \"2025-01-23T04:30:00Z\"\r\n ]\r\n },\r\n \"retentionPolicy\": {\r\n \"retentionPolicyType\": \"LongTermRetentionPolicy\",\r\n \"dailySchedule\": {\r\n \"retentionTimes\": [\r\n \"2025-01-23T04:30:00Z\"\r\n ],\r\n \"retentionDuration\": {\r\n \"count\": 30,\r\n \"durationType\": \"Days\"\r\n }\r\n }\r\n },\r\n \"timeZone\": \"UTC\"\r\n }\r\n}", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "c392bada-2241-4d0b-8077-78074a46e6b5" + ], + "x-ms-client-request-id": [ + "51b52a0c-34b7-4c4c-80f5-f48b2ac7dd1d" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "799" + ], + "x-ms-ratelimit-remaining-subscription-global-writes": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "c392bada-2241-4d0b-8077-78074a46e6b5" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20250123T175542Z:c392bada-2241-4d0b-8077-78074a46e6b5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 831D7AB842FD4B31BE5970522E9A4616 Ref B: MAA201060513047 Ref C: 2025-01-23T17:55:40Z" + ], + "Date": [ + "Thu, 23 Jan 2025 17:55:42 GMT" + ], + "Content-Length": [ + "751" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault/backupPolicies/AzureFilesPolicy\",\r\n \"name\": \"AzureFilesPolicy\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults/backupPolicies\",\r\n \"properties\": {\r\n \"backupManagementType\": \"AzureStorage\",\r\n \"workLoadType\": \"AzureFileShare\",\r\n \"schedulePolicy\": {\r\n \"schedulePolicyType\": \"SimpleSchedulePolicy\",\r\n \"scheduleRunFrequency\": \"Daily\",\r\n \"scheduleRunTimes\": [\r\n \"2025-01-23T04:30:00Z\"\r\n ],\r\n \"scheduleWeeklyFrequency\": 0\r\n },\r\n \"retentionPolicy\": {\r\n \"retentionPolicyType\": \"LongTermRetentionPolicy\",\r\n \"dailySchedule\": {\r\n \"retentionTimes\": [\r\n \"2025-01-23T04:30:00Z\"\r\n ],\r\n \"retentionDuration\": {\r\n \"count\": 30,\r\n \"durationType\": \"Days\"\r\n }\r\n }\r\n },\r\n \"timeZone\": \"UTC\",\r\n \"protectedItemsCount\": 0\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault/backupPolicies/AzureVMPolicy?api-version=2024-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjJlZGZkNWQtNTQ5Ni00NjgzLWI5NGYtYjM1ODhjNTc5MDA5L3Jlc291cmNlR3JvdXBzL3NnaG9sYXBDWlJUZXN0aW5nL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy92YXVsdHMvc2dob2xhcFpSU1Rlc3RpbmdWYXVsdC9iYWNrdXBQb2xpY2llcy9BenVyZVZNUG9saWN5P2FwaS12ZXJzaW9uPTIwMjQtMDQtMDE=", + "RequestMethod": "DELETE", + "RequestHeaders": { + "x-ms-client-request-id": [ + "30a8fa55-6511-4803-b22b-6217b0ef3826" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/6.0.3624.51421", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.Backup.RecoveryServicesBackupClient/7.4.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "e7b9b6af-ded0-4788-8ffe-6c589f92ad7d" + ], + "x-ms-client-request-id": [ + "30a8fa55-6511-4803-b22b-6217b0ef3826" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "799" + ], + "x-ms-ratelimit-remaining-subscription-global-deletes": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "e7b9b6af-ded0-4788-8ffe-6c589f92ad7d" + ], + "x-ms-routing-request-id": [ + "CENTRALINDIA:20250123T175546Z:e7b9b6af-ded0-4788-8ffe-6c589f92ad7d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: 789B2211557A4174964B97128DA8B6FD Ref B: MAA201060516029 Ref C: 2025-01-23T17:55:44Z" + ], + "Date": [ + "Thu, 23 Jan 2025 17:55:45 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f2edfd5d-5496-4683-b94f-b3588c579009/resourceGroups/sgholapCZRTesting/providers/Microsoft.RecoveryServices/vaults/sgholapZRSTestingVault/backupPolicies/AzureFilesPolicy?api-version=2024-04-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjJlZGZkNWQtNTQ5Ni00NjgzLWI5NGYtYjM1ODhjNTc5MDA5L3Jlc291cmNlR3JvdXBzL3NnaG9sYXBDWlJUZXN0aW5nL3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVjb3ZlcnlTZXJ2aWNlcy92YXVsdHMvc2dob2xhcFpSU1Rlc3RpbmdWYXVsdC9iYWNrdXBQb2xpY2llcy9BenVyZUZpbGVzUG9saWN5P2FwaS12ZXJzaW9uPTIwMjQtMDQtMDE=", + "RequestMethod": "DELETE", + "RequestHeaders": { + "x-ms-client-request-id": [ + "bdf505eb-945f-489c-ab1d-0050d8e14be5" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/6.0.3624.51421", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.26100", + "Microsoft.Azure.Management.RecoveryServices.Backup.RecoveryServicesBackupClient/7.4.0" + ] + }, + "RequestBody": "", + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "5fef232f-d89d-4c6e-9e91-df14b349f84d" + ], + "x-ms-client-request-id": [ + "bdf505eb-945f-489c-ab1d-0050d8e14be5" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "799" + ], + "x-ms-ratelimit-remaining-subscription-global-deletes": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "5fef232f-d89d-4c6e-9e91-df14b349f84d" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20250123T175548Z:5fef232f-d89d-4c6e-9e91-df14b349f84d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Cache": [ + "CONFIG_NOCACHE" + ], + "X-MSEdge-Ref": [ + "Ref A: BF80A7C060374FE3AAD3E12A6E8A653E Ref B: MAA201060513047 Ref C: 2025-01-23T17:55:47Z" + ], + "Date": [ + "Thu, 23 Jan 2025 17:55:48 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "f2edfd5d-5496-4683-b94f-b3588c579009" + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup/Cmdlets/ProtectionPolicy/GetAzureRmRecoveryServicesBackupSchedulePolicyObject.cs b/src/RecoveryServices/RecoveryServices.Backup/Cmdlets/ProtectionPolicy/GetAzureRmRecoveryServicesBackupSchedulePolicyObject.cs index 1e0dd7de8085..05c26460f9f1 100644 --- a/src/RecoveryServices/RecoveryServices.Backup/Cmdlets/ProtectionPolicy/GetAzureRmRecoveryServicesBackupSchedulePolicyObject.cs +++ b/src/RecoveryServices/RecoveryServices.Backup/Cmdlets/ProtectionPolicy/GetAzureRmRecoveryServicesBackupSchedulePolicyObject.cs @@ -62,12 +62,34 @@ public class GetAzureRmRecoveryServicesBackupSchedulePolicyObject : RecoveryServ [ValidateSet("Daily", "Hourly", "Weekly")] public ScheduleRunType ScheduleRunFrequency = ScheduleRunType.Daily; + private PSPolicyType? _policySubType; /// /// Schedule policy subtype. /// [Parameter(Mandatory = false, Position = 3, HelpMessage = ParamHelpMsgs.Policy.SchedulePolicySubType)] - public PSPolicyType PolicySubType = PSPolicyType.Standard; + public PSPolicyType PolicySubType + { + get + { + if(_policySubType == null) + { + if(WorkloadType == WorkloadType.AzureVM) + { + return PSPolicyType.Enhanced; + } + else + { + return PSPolicyType.Standard; + } + } + return (PSPolicyType)_policySubType; + } + set + { + _policySubType = value; + } + } public override void ExecuteCmdlet() { diff --git a/src/RecoveryServices/RecoveryServices/ChangeLog.md b/src/RecoveryServices/RecoveryServices/ChangeLog.md index e0bf49c7d9e4..ecee33c79dac 100644 --- a/src/RecoveryServices/RecoveryServices/ChangeLog.md +++ b/src/RecoveryServices/RecoveryServices/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* Updated `GetAzureRmRecoveryServicesBackupSchedulePolicyObject` to default the `PolicySubType` to `Enhanced` for AzureVM. ## Version 7.4.0 * Upgraded nuget package to signed package. diff --git a/src/RecoveryServices/RecoveryServices/help/Get-AzRecoveryServicesBackupSchedulePolicyObject.md b/src/RecoveryServices/RecoveryServices/help/Get-AzRecoveryServicesBackupSchedulePolicyObject.md index 448f99f2363a..62db8a412a98 100644 --- a/src/RecoveryServices/RecoveryServices/help/Get-AzRecoveryServicesBackupSchedulePolicyObject.md +++ b/src/RecoveryServices/RecoveryServices/help/Get-AzRecoveryServicesBackupSchedulePolicyObject.md @@ -41,17 +41,19 @@ The last command creates a backup protection policy with the updated schedule. ### Example 2: Set the backup time ```powershell -$SchPol = Get-AzRecoveryServicesBackupSchedulePolicyObject -WorkloadType "AzureVM" -$SchPol.ScheduleRunTimes.RemoveAll() -$DT = Get-Date +$SchPol = Get-AzRecoveryServicesBackupSchedulePolicyObject -WorkloadType "AzureVM" -PolicySubType Standard +$RetPol = Get-AzRecoveryServicesBackupRetentionPolicyObject -WorkloadType "AzureVM" +$SchPol.ScheduleRunTimes.clear() +$DT = Get-Date -Date "2025-01-24 14:30" $SchPol.ScheduleRunTimes.Add($DT.ToUniversalTime()) New-AzRecoveryServicesBackupProtectionPolicy -Name "NewPolicy" -WorkloadType AzureVM -RetentionPolicy $RetPol -SchedulePolicy $SchPol ``` The first command gets the schedule policy object, and then stores it in the $SchPol variable. -The second command removes all scheduled run times from $SchPol. -The third command gets the current date and time, and then stores it in the $DT variable. -The fourth command replaces the scheduled run times with the current time. +The second command gets the retention policy object, and then stores it in the $RetPol variable. +The third command removes all scheduled run times from $SchPol. +The fourth command gets the date and time, and then stores it in the $DT variable. +The fifth command replaces the scheduled run times with the time in fourth command. You can only backup AzureVM once per day, so to reset the backup time you must replace the original schedule. The last command creates a backup protection policy using the new schedule. @@ -77,9 +79,9 @@ $schedulePolicy = Get-AzRecoveryServicesBackupSchedulePolicyObject -WorkloadType $timeZone = Get-TimeZone -ListAvailable | Where-Object { $_.Id -match "India" } $schedulePolicy.ScheduleRunTimeZone = $timeZone.Id $windowStartTime = (Get-Date -Date "2022-04-14T08:00:00.00+00:00").ToUniversalTime() -$schPol.HourlySchedule.WindowStartTime = $windowStartTime -$schedulePolicy.HourlySchedule.ScheduleInterval = 4 -$schedulePolicy.HourlySchedule.ScheduleWindowDuration = 23 +$schedulePolicy.HourlySchedule.WindowStartTime = $windowStartTime +$schedulePolicy.HourlySchedule.Interval = 4 +$schedulePolicy.HourlySchedule.WindowDuration = 23 ``` The first command gets a base enhanced hourly **SchedulePolicyObject** for WorkloadType AzureVM, and then stores it in the $schedulePolicy variable.