Skip to content

Commit

Permalink
Fixing SQL AG restore, removing the container name check (#13744)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiaga authored Dec 16, 2020
1 parent 4b2b765 commit 29ff833
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 28 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,6 @@ Please contact Microsoft for further assistance.</value>
<data name="TargetVaultStorageRedundancy" xml:space="preserve">
<value>Are you sure you want to copy items to the {0} whose storage redundancy is {1}</value>
</data>
<data name="ContainerNameIsInvalid" xml:space="preserve">
<value>container name is invalid.</value>
</data>
<data name="TargetResourcegroupNotSupported" xml:space="preserve">
<value>Target ResourceGroup is not applicable and restore will proceed as unmanaged disk restore since this is unmanaged VM</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,17 +279,7 @@ public void ValidateSQLSchedulePolicy(CmdletModel.SchedulePolicyBase policy)
// call validation
policy.Validate();
}

public void ValidateContainerName(String containerName)
{
if (!containerName.Contains(";"))
{
throw new ArgumentException(
string.Format(
Resources.ContainerNameIsInvalid));
}
}


public void ValidateLongTermRetentionPolicy(CmdletModel.RetentionPolicyBase policy, string backupManagementType = "")
{
if (policy == null || policy.GetType() != typeof(CmdletModel.LongTermRetentionPolicy))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class AzureWorkloadPsBackupProvider : IPsBackupProvider
Dictionary<Enum, object> ProviderData { get; set; }
ServiceClientAdapter ServiceClientAdapter { get; set; }
AzureWorkloadProviderHelper AzureWorkloadProviderHelper { get; set; }

/// <summary>
/// Initializes the provider with the data received from the cmdlet layer
/// </summary>
Expand Down Expand Up @@ -404,9 +405,6 @@ public RestAzureNS.AzureOperationResponse TriggerRestore()

if (wLRecoveryConfig.RecoveryPoint.ContainerName != null && wLRecoveryConfig.FullRP == null)
{
// validate container name to be a full name
AzureWorkloadProviderHelper.ValidateContainerName(wLRecoveryConfig.RecoveryPoint.ContainerName);

AzureWorkloadSQLRestoreRequest azureWorkloadSQLRestoreRequest =
new AzureWorkloadSQLRestoreRequest();

Expand Down
1 change: 1 addition & 0 deletions src/RecoveryServices/RecoveryServices/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
-->
## Upcoming Release
* Enabled softdelete feature for SQL.
* Fixing SQL AG restore, removing the container name check.

## Version 3.1.0
* Made help text and parameter set name changes to `Restore-AzRecoveryServicesBackupItem` cmdlet.
Expand Down

0 comments on commit 29ff833

Please sign in to comment.