diff --git a/src/RecoveryServices/RecoveryServices.Backup/Cmdlets/Item/DisableAzureRmRecoveryServicesBackupAutoProtection.cs b/src/RecoveryServices/RecoveryServices.Backup/Cmdlets/Item/DisableAzureRmRecoveryServicesBackupAutoProtection.cs index 08da78a27411..a0c0030b11f4 100644 --- a/src/RecoveryServices/RecoveryServices.Backup/Cmdlets/Item/DisableAzureRmRecoveryServicesBackupAutoProtection.cs +++ b/src/RecoveryServices/RecoveryServices.Backup/Cmdlets/Item/DisableAzureRmRecoveryServicesBackupAutoProtection.cs @@ -123,9 +123,10 @@ public override void ExecuteCmdlet() containerNameResponse = HelperUtils.GetContainerUri( keyValueDictResponse, itemResponse.Properties.ItemId); - if (String.Compare(itemNameResponse, itemName, true) == 0 && - String.Compare(containerUri.Split(';')[3], containerNameResponse.Split(';')[2], true) == 0) - { + if((String.Compare(itemNameResponse, itemName, true) == 0) && + ((itemType.Contains("sqlavailabilitygroup") && String.Compare(containerUri.Split(';')[1], containerNameResponse, true) == 0) + || (String.Compare(containerUri.Split(';')[3], containerNameResponse.Split(';')[2], true) == 0))) + { intentName = itemResponse.Name; break; } diff --git a/src/RecoveryServices/RecoveryServices/ChangeLog.md b/src/RecoveryServices/RecoveryServices/ChangeLog.md index f3ccef8f3131..21bc5f88bc82 100644 --- a/src/RecoveryServices/RecoveryServices/ChangeLog.md +++ b/src/RecoveryServices/RecoveryServices/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* Fixed Disable SQL AG AutoProtection. * Added cross tenant DS Move. * Removed restriction to fetch recovery points only for a 30 days time range. * Enabled CRR for new regions.