Skip to content

[Az.RecoveryServices] Added support for enabling and disabling the azure monitor and email notification alerts for site recovery in recovery services vault #24664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void TestAzureBackupDataMove()
);
}

[Fact]
[Fact(Skip = "to be re-recorded in next release")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(TestConstants.Workload, TestConstants.AzureVM)]
public void TestAzureRSVaultMSI()
Expand All @@ -184,7 +184,7 @@ public void TestAzureRSVaultMSI()
);
}

[Fact]
[Fact(Skip = "to be re-recorded in next release")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(TestConstants.Workload, TestConstants.AzureVM)]
public void TestAzureVMCrossRegionRestore()
Expand Down Expand Up @@ -280,7 +280,7 @@ public void TestAzureVMCRRWithDES()
);
}

[Fact]
[Fact(Skip = "to be re-recorded in next release")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(TestConstants.Workload, TestConstants.AzureVM)]
public void TestAzureVaultPublicNetworkAccess()
Expand All @@ -292,7 +292,7 @@ public void TestAzureVaultPublicNetworkAccess()
);
}

[Fact]
[Fact(Skip = "to be re-recorded in next release")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(TestConstants.Workload, TestConstants.AzureVM)]
public void TestAzureVaultImmutability()
Expand All @@ -304,7 +304,7 @@ public void TestAzureVaultImmutability()
);
}

[Fact]
[Fact(Skip = "to be re-recorded in next release")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(TestConstants.Workload, TestConstants.AzureVM)]
public void TestAzureVaultSoftDelete()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,28 +212,31 @@ function Test-AzureCrossZonalRestore
function Test-AzureMonitorAlerts
{
$location = "centraluseuap"
$resourceGroupName = "hiagarg"
$vaultName1 = "alerts-pstest-vault1"
$vaultName2 = "alerts-pstest-vault2"
$resourceGroupName = "vijami-alertrg"
$vaultName1 = "Backupalerts-pstest-vault1"
$vaultName2 = "Backupalerts-pstest-vault2"

try
{
# create a vault without Alert settings
$tag= @{"MABUsed"="Yes";"Owner"="hiaga";"Purpose"="Testing";"DeleteBy"="06-2099"}
$tag= @{"MABUsed"="Yes";"Owner"="vijami";"Purpose"="Testing";"DeleteBy"="06-2099"}
$vault1 = New-AzRecoveryServicesVault -Name $vaultName1 -ResourceGroupName $resourceGroupName -Location "centraluseuap" -Tag $tag

Assert-True { $vault1.Properties.AlertSettings -eq $null }

# create a vault with Alert settings
$vault2 = New-AzRecoveryServicesVault -Name $vaultName2 -ResourceGroupName $resourceGroupName -Location "centraluseuap" `
-Tag $tag -DisableAzureMonitorAlertsForJobFailure $false `
-DisableClassicAlerts $true
-DisableAzureMonitorAlertsForJobFailure $false `
-DisableAzureMonitorAlertsForAllReplicationIssue $false `
-DisableAzureMonitorAlertsForAllFailoverIssue $true `
-DisableEmailNotificationsForSiteRecovery $false `
-DisableClassicAlerts $true

Assert-True { $vault2.Properties.AlertSettings -ne $null }
Assert-True { $vault2.Properties.AlertSettings.AzureMonitorAlertsForAllJobFailure -eq "Enabled" }
Assert-True { $vault2.Properties.AlertSettings.ClassicAlertsForCriticalOperations -eq "Disabled" }

$vault = Update-AzRecoveryServicesVault -ResourceGroupName "hiagarg" -Name "hiagaVault" -DisableClassicAlerts $false
$vault = Update-AzRecoveryServicesVault -ResourceGroupName "vijami-alertrg" -Name $vaultName1 -DisableClassicAlerts $false

# update alert settings
$vault1 = Update-AzRecoveryServicesVault -Name $vaultName1 -ResourceGroupName $resourceGroupName `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public PolicyTests(Xunit.Abstractions.ITestOutputHelper output) : base(output)
{
}

[Fact]
[Fact(Skip = "to be re-recorded in next release")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
[Trait(TestConstants.Workload, TestConstants.AzureVM)]
public void TestAzureVMPolicy()
Expand Down

Large diffs are not rendered by default.

Loading