Closed YaroBear closed 4 years ago
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @srinathvasireddy
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @srinathvasireddy
Needs Recovery service team to look into this ask.
I just realized I was tracing the wrong exception message in code... The lines of code that were throwing the error are all the ones that call this line: https://github.com/Azure/azure-powershell/blob/5a7b2698c62b666a1fddbfd709598985e1f91a71/src/RecoveryServices/RecoveryServices.Backup.Helpers/Validations/PolicyValidations.cs#L245
So please ignore what I had above... However, I still do see potentially one improvement: https://github.com/Azure/azure-powershell/blob/5a7b2698c62b666a1fddbfd709598985e1f91a71/src/RecoveryServices/RecoveryServices.Backup.Helpers/Validations/PolicyValidations.cs#L70
This line throws the same error, which is misleading because it is checking to see if ltrPolicy.WeeklySchedule.DaysOfTheWeek
is a subset schPolicy.ScheduleRunDays
. So it has nothing to do with Monthly and Yearly retention schedules.
Other than that, feel free to close this issue! Thanks.
@YaroBear : Thanks for the feedback. We will incorporate this in future releases.
hi i am having the same issue, when i disable daily backup and just use weekly (montly, yearly set to null)using powershell. i get exact same error as mentioned above, this is vor IaaS VM backup. what is the fix for this please.
if i ,however, set the scheduleRunDay to "Sunday" it just works but not any other day.
Description
When trying to create a weekly backup retention policy using
New-AzRecoveryServicesBackupProtectionPolicy
, I get an error that doesn't make sense to me in two ways:I think the error message should either be changed to something like "The DaysOfWeek count in the retention policy should match the the ScheduleRunDays count in the schedule policy"
or
the logic be changed to match the meaning of the error. E.g. { Monday, Tuesday } is a subset of { Monday, Tuesday, Wednesday }
$schedulePolicy.FullBackupSchedulePolicy.ScheduleRunDays.Count
Output: 1$retentionPolicy.FullBackupRetentionPolicy.WeeklySchedule.DaysOfTheWeek.Count
Output: 1Error mentions yearly and monthly retention policies, but the linked code doesn't touch these objects:
$retentionPolicy.FullBackupRetentionPolicy.MonthlySchedule
$retentionPolicy.FullBackupRetentionPolicy.YearlySchedule
Steps to reproduce
Environment data
Module versions
Debug output
Error output