다음을 통해 공유


Update-AzScheduledQueryRule

로그 경고 규칙을 업데이트합니다.

구문

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

Description

로그 경고 규칙을 업데이트합니다. 이 명령에서는 "Enabled" 속성만 업데이트할 수 있습니다. 다른 속성을 업데이트하려면 "Set-AzScheduledQueryRule" 명령을 참조하세요.

예제

예제 1 - 규칙 이름으로 업데이트

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/ad825170-845c-47db-8f00-11978947b089/resourceGroups/MyResourceGroup/providers/microsoft.insights/scheduledqueryrules/LogAlertRule1
Name              : LogAlertRule1
Type              : microsoft.insights/scheduledqueryrules
Location          : centralindia
Tags              : {[hidden-link:/subscriptions/ad825170-845c-47db-8f00-11978947b089/resourceGroups/MyResourceGroup/providers/Microsoft.OperationalInsights/workspaces/MyWorkspace, Resource]}

예제 2 - 입력 개체별 업데이트

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/ad825170-845c-47db-8f00-11978947b089/resourceGroups/MyResourceGroup/providers/microsoft.insights/scheduledqueryrules/LogAlertRule1
Name              : LogAlertRule1
Type              : microsoft.insights/scheduledqueryrules
Location          : centralindia
Tags              : {[hidden-link:/subscriptions/ad825170-845c-47db-8f00-11978947b089/resourceGroups/MyResourceGroup/providers/Microsoft.OperationalInsights/workspaces/MyWorkspace, Resource]}

예제 3 - 리소스 ID별 업데이트

PS C:\> Update-AzScheduledQueryRule -ResourceId /subscriptions/ad825170-845c-47db-8f00-11978947b089/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/ad825170-845c-47db-8f00-11978947b089/resourceGroups/MyResourceGroup/providers/microsoft.insights/scheduledqueryrules/LogAlertRule1
Name              : LogAlertRule1
Type              : microsoft.insights/scheduledqueryrules
Location          : centralindia
Tags              : {[hidden-link:/subscriptions/ad825170-845c-47db-8f00-11978947b089/resourceGroups/MyResourceGroup/providers/Microsoft.OperationalInsights/workspaces/MyWorkspace, Resource]}

매개 변수

-Confirm

cmdlet을 실행하기 전에 확인 메시지가 표시됩니다.

형식:SwitchParameter
별칭:cf
Position:Named
Default value:None
필수:False
파이프라인 입력 허용:False
와일드카드 문자 허용:False

-DefaultProfile

Azure와의 통신에 사용되는 자격 증명, 계정, 테넌트 및 구독입니다.

형식:IAzureContextContainer
별칭:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
필수:False
파이프라인 입력 허용:False
와일드카드 문자 허용:False

-Enabled

azure 경고 상태 - 유효한 값 - $true, $false

형식:Boolean
Position:Named
Default value:None
필수:True
파이프라인 입력 허용:False
와일드카드 문자 허용:False

-InputObject

예약된 쿼리 규칙 리소스

형식:PSScheduledQueryRuleResource
Position:Named
Default value:None
필수:True
파이프라인 입력 허용:True
와일드카드 문자 허용:False

-Name

경고 이름

형식:String
Position:Named
Default value:None
필수:True
파이프라인 입력 허용:False
와일드카드 문자 허용:False

-ResourceGroupName

리소스 그룹 이름

형식:String
Position:Named
Default value:None
필수:True
파이프라인 입력 허용:False
와일드카드 문자 허용:False

-ResourceId

리소스 ID

형식:String
Position:Named
Default value:None
필수:True
파이프라인 입력 허용:True
와일드카드 문자 허용:False

-WhatIf

cmdlet이 실행될 경우 결과 동작을 표시합니다. cmdlet이 실행되지 않습니다.

형식:SwitchParameter
별칭:wi
Position:Named
Default value:None
필수:False
파이프라인 입력 허용:False
와일드카드 문자 허용:False

입력

PSScheduledQueryRuleResource

String

출력

PSScheduledQueryRuleResource