Freigeben über


Update-AzScheduledQueryRule

Updates a Log Alert rule

Syntax

ByRuleName (Standardwert)

Update-AzScheduledQueryRule
    -Name <String>
    -ResourceGroupName <String>
    -Enabled <Boolean>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByInputObject

Update-AzScheduledQueryRule
    -InputObject <PSScheduledQueryRuleResource>
    -Enabled <Boolean>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByResourceId

Update-AzScheduledQueryRule
    -ResourceId <String>
    -Enabled <Boolean>
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Beschreibung

Updates a Log Alert rule, updating only "Enabled" property is supported by this command. To update other properties, see "Set-AzScheduledQueryRule" command.

Beispiele

Example 1 - Update by rule name

PS C:\> Update-AzScheduledQueryRule -ResourceGroupName "MyResourceGroup" -Name "LogAlertRule1" -Enabled $false

Description       : description
Enabled           : false
LastUpdatedTime   : 19-Apr-19 12:49:15 PM
ProvisioningState : Succeeded
Source            : Microsoft.Azure.Management.Monitor.Models.Source
Schedule          : Microsoft.Azure.Management.Monitor.Models.Schedule
Action            : Microsoft.Azure.Management.Monitor.Models.AlertingAction
Id                : /subscriptions/a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/resourceGroups/MyResourceGroup/providers/microsoft.insights/scheduledqueryrules/LogAlertRule1
Name              : LogAlertRule1
Type              : microsoft.insights/scheduledqueryrules
Location          : centralindia
Tags              : {[hidden-link:/subscriptions/a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/resourceGroups/MyResourceGroup/providers/Microsoft.OperationalInsights/workspaces/MyWorkspace, Resource]}

Example 2 - Update by input object

PS C:\> Update-AzScheduledQueryRule -InputObject $sqr -Enabled $false

Description       : description
Enabled           : false
LastUpdatedTime   : 19-Apr-19 12:50:18 PM
ProvisioningState : Succeeded
Source            : Microsoft.Azure.Management.Monitor.Models.Source
Schedule          : Microsoft.Azure.Management.Monitor.Models.Schedule
Action            : Microsoft.Azure.Management.Monitor.Models.AlertingAction
Id                : /subscriptions/a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/resourceGroups/MyResourceGroup/providers/microsoft.insights/scheduledqueryrules/LogAlertRule1
Name              : LogAlertRule1
Type              : microsoft.insights/scheduledqueryrules
Location          : centralindia
Tags              : {[hidden-link:/subscriptions/a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/resourceGroups/MyResourceGroup/providers/Microsoft.OperationalInsights/workspaces/MyWorkspace, Resource]}

Example 3 - Update by resource Id

PS C:\> Update-AzScheduledQueryRule -ResourceId /subscriptions/a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/resourceGroups/MyResourceGroup/providers/microsoft.insights/scheduledqueryrules/LogAlertRule1 -Enabled $true

Description       : description
Enabled           : true
LastUpdatedTime   : 19-Apr-19 12:51:14 PM
ProvisioningState : Succeeded
Source            : Microsoft.Azure.Management.Monitor.Models.Source
Schedule          : Microsoft.Azure.Management.Monitor.Models.Schedule
Action            : Microsoft.Azure.Management.Monitor.Models.AlertingAction
Id                : /subscriptions/a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/resourceGroups/MyResourceGroup/providers/microsoft.insights/scheduledqueryrules/LogAlertRule1
Name              : LogAlertRule1
Type              : microsoft.insights/scheduledqueryrules
Location          : centralindia
Tags              : {[hidden-link:/subscriptions/a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/resourceGroups/MyResourceGroup/providers/Microsoft.OperationalInsights/workspaces/MyWorkspace, Resource]}

Parameter

-Confirm

Prompts you for confirmation before running the cmdlet.

Parametereigenschaften

Typ:SwitchParameter
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False
Aliase:cf

Parametersätze

(All)
Position:Named
Obligatorisch.:False
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parametereigenschaften

Typ:IAzureContextContainer
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False
Aliase:AzContext, AzureRmContext, AzureCredential

Parametersätze

(All)
Position:Named
Obligatorisch.:False
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-Enabled

The azure alert state - valid values - $true, $false

Parametereigenschaften

Typ:Boolean
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

(All)
Position:Named
Obligatorisch.:True
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-InputObject

The Scheduled Query Rule resource

Parametereigenschaften

Typ:PSScheduledQueryRuleResource
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

ByInputObject
Position:Named
Obligatorisch.:True
Wert aus Pipeline:True
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-Name

The alert name

Parametereigenschaften

Typ:String
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

ByRuleName
Position:Named
Obligatorisch.:True
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-ResourceGroupName

The resource group name

Parametereigenschaften

Typ:String
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

ByRuleName
Position:Named
Obligatorisch.:True
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

-ResourceId

The resource Id

Parametereigenschaften

Typ:String
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False

Parametersätze

ByResourceId
Position:Named
Obligatorisch.:True
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:True
Wert aus verbleibenden Argumenten:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parametereigenschaften

Typ:SwitchParameter
Standardwert:None
Unterstützt Platzhalter:False
Nicht anzeigen:False
Aliase:wi

Parametersätze

(All)
Position:Named
Obligatorisch.:False
Wert aus Pipeline:False
Wert aus Pipeline nach dem Eigenschaftsnamen:False
Wert aus verbleibenden Argumenten:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Eingaben

PSScheduledQueryRuleResource

String

Ausgaben

PSScheduledQueryRuleResource