Skip to content

Commit 9271032

Browse files
committed
Fix Close Alert
1 parent 08ad9be commit 9271032

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Infrastructure/AzureStack.Infra.psm1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Function Get-AzSInfraRole{
163163
$subscription, $headers = (Get-AzureStackAdminSubTokenHeader -TenantId $tenantId -AzureStackCredentials $azureStackCredentials -EnvironmentName $EnvironmentName)
164164
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system.$region/providers/Microsoft.Fabric.Admin/fabricLocations/$region/InfraRoles?api-version=2016-05-01"
165165
$Roles=Invoke-RestMethod -Method GET -Uri $uri -ContentType 'application/json' -Headers $Headers
166-
$roles.value
166+
$roles.value|select name,properties
167167

168168
}
169169
export-modulemember -function Get-AzSInfraRole
@@ -432,7 +432,7 @@ Function Close-AzSAlert{
432432
[ValidateNotNullorEmpty()]
433433
[System.Management.Automation.PSCredential] $azureStackCredentials,
434434

435-
[Parameter(Mandatory=$true, HelpMessage="The Azure Stack Administrator Environment Name", ParameterSetName='CloseAlert')]
435+
[Parameter(Mandatory=$true, HelpMessage="The Azure Stack Administrator Environment Name", ParameterSetName='closealert')]
436436
[string] $EnvironmentName,
437437

438438
[Parameter(ParameterSetName='closealert')]
@@ -452,7 +452,6 @@ Function Close-AzSAlert{
452452
$Alerts.properties.state = "Closed"
453453
$AlertUpdateBody = $Alerts | ConvertTo-Json
454454
$URI= "${ArmEndpoint}/subscriptions/${subscription}/resourceGroups/system.$region/providers/Microsoft.InfrastructureInsights.Admin/regionHealths/$region/Alerts/${alertname}?api-version=2016-05-01"
455-
$URI
456455
$Close=Invoke-RestMethod -Method PUT -Uri $uri -ContentType 'application/json' -Headers $Headers -Body $AlertUpdateBody
457456
$CloseRun=$Close.value
458457
$closeRun

0 commit comments

Comments
 (0)