diff --git a/internal/services/recoveryservices/backup_policy_file_share_resource.go b/internal/services/recoveryservices/backup_policy_file_share_resource.go index 463aadd67c85..94d9e63a279b 100644 --- a/internal/services/recoveryservices/backup_policy_file_share_resource.go +++ b/internal/services/recoveryservices/backup_policy_file_share_resource.go @@ -326,7 +326,7 @@ func expandBackupProtectionPolicyFileShareRetentionMonthly(d *pluginsdk.Resource scheduleFormat := protectionpolicies.RetentionScheduleFormatWeekly var weekly *protectionpolicies.WeeklyRetentionFormat = nil var daily *protectionpolicies.DailyRetentionFormat = nil - if v, ok := block["days"]; ok && v.(*pluginsdk.Set).Len() > 0 { + if v, ok := block["days"]; ok && v.(*pluginsdk.Set).Len() > 0 || block["include_last_days"].(bool) { scheduleFormat = protectionpolicies.RetentionScheduleFormatDaily daily = expandBackupProtectionPolicyFileShareRetentionDailyFormat(block) } else { @@ -357,7 +357,7 @@ func expandBackupProtectionPolicyFileShareRetentionYearly(d *pluginsdk.ResourceD scheduleFormat := protectionpolicies.RetentionScheduleFormatWeekly var weekly *protectionpolicies.WeeklyRetentionFormat = nil var daily *protectionpolicies.DailyRetentionFormat = nil - if v, ok := block["days"]; ok && v.(*pluginsdk.Set).Len() > 0 { + if v, ok := block["days"]; ok && v.(*pluginsdk.Set).Len() > 0 || block["include_last_days"].(bool) { scheduleFormat = protectionpolicies.RetentionScheduleFormatDaily daily = expandBackupProtectionPolicyFileShareRetentionDailyFormat(block) } else { diff --git a/internal/services/recoveryservices/backup_policy_vm_resource.go b/internal/services/recoveryservices/backup_policy_vm_resource.go index 722223dc10e8..bdfd54eedcf0 100644 --- a/internal/services/recoveryservices/backup_policy_vm_resource.go +++ b/internal/services/recoveryservices/backup_policy_vm_resource.go @@ -453,7 +453,7 @@ func expandBackupProtectionPolicyVMRetentionMonthly(d *pluginsdk.ResourceData, t scheduleFormat := protectionpolicies.RetentionScheduleFormatWeekly var weekly *protectionpolicies.WeeklyRetentionFormat = nil var daily *protectionpolicies.DailyRetentionFormat = nil - if v, ok := block["days"]; ok && v.(*pluginsdk.Set).Len() > 0 { + if v, ok := block["days"]; ok && v.(*pluginsdk.Set).Len() > 0 || block["include_last_days"].(bool) { scheduleFormat = protectionpolicies.RetentionScheduleFormatDaily daily = expandBackupProtectionPolicyVMRetentionDailyFormat(block) } else { @@ -484,7 +484,7 @@ func expandBackupProtectionPolicyVMRetentionYearly(d *pluginsdk.ResourceData, ti scheduleFormat := protectionpolicies.RetentionScheduleFormatWeekly var weekly *protectionpolicies.WeeklyRetentionFormat = nil var daily *protectionpolicies.DailyRetentionFormat = nil - if v, ok := block["days"]; ok && v.(*pluginsdk.Set).Len() > 0 { + if v, ok := block["days"]; ok && v.(*pluginsdk.Set).Len() > 0 || block["include_last_days"].(bool) { scheduleFormat = protectionpolicies.RetentionScheduleFormatDaily daily = expandBackupProtectionPolicyVMRetentionDailyFormat(block) } else {