Set-AzScheduledQueryRule
Atualiza uma regra de alerta de log
Sintaxe
Set-AzScheduledQueryRule
-Source <PSScheduledQueryRuleSource>
[-Schedule <PSScheduledQueryRuleSchedule>]
-Action <PSScheduledQueryRuleAlertingAction>
-Location <String>
[-Description <String>]
-Name <String>
-ResourceGroupName <String>
[-Tag <Hashtable>]
[-Enabled <Boolean>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzScheduledQueryRule
-InputObject <PSScheduledQueryRuleResource>
[-Source <PSScheduledQueryRuleSource>]
[-Schedule <PSScheduledQueryRuleSchedule>]
[-Action <PSScheduledQueryRuleAlertingAction>]
[-Location <String>]
[-Description <String>]
[-Tag <Hashtable>]
[-Enabled <Boolean>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzScheduledQueryRule
-ResourceId <String>
-Source <PSScheduledQueryRuleSource>
[-Schedule <PSScheduledQueryRuleSchedule>]
-Action <PSScheduledQueryRuleAlertingAction>
-Location <String>
[-Description <String>]
[-Tag <Hashtable>]
[-Enabled <Boolean>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Atualiza uma regra de alerta de log pela semântica PUT
Exemplos
Exemplo 1 - Definido pelo nome da regra
PS C:\> Set-AzScheduledQueryRule -ResourceGroupName "MyResourceGroup" -Name "LogAlertRule1" -Enabled $true -Location "centralindia" -Action $alertingAction -Description "log alert description" -Schedule $schedule -Source $source
Description : log alert description
Enabled : true
LastUpdatedTime : 19-Apr-19 12:45:04 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]}
Exemplo 2 - Definido por objeto de entrada
PS C:\> Set-AzScheduledQueryRule -InputObject $sqr -Description "changed description"
Description : changed description
Enabled : true
LastUpdatedTime : 19-Apr-19 12:46:38 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]}
Exemplo 3 - Definido por ID do recurso
PS C:\> Set-AzScheduledQueryRule -ResourceId "/subscriptions/ad825170-845c-47db-8f00-11978947b089/resourceGroups/MyResourceGroup/providers/microsoft.insights/scheduledqueryrules/LogAlertRule1" -Enabled $true -Location "centralindia" -Action $alertingAction -Description "change description again" -Schedule $schedule -Source $source
Description : change description again
Enabled : true
LastUpdatedTime : 19-Apr-19 12:47:59 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]}
Parâmetros
-Action
A Ação de Alerta da regra de consulta agendada
Tipo: | PSScheduledQueryRuleAlertingAction |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-AsJob
Executar cmdlet em segundo plano
Tipo: | SwitchParameter |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-Confirm
Solicita a sua confirmação antes de executar o cmdlet.
Tipo: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-DefaultProfile
As credenciais, a conta, o locatário e a assinatura usados para comunicação com o Azure.
Tipo: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-Description
A descrição deste alerta
Tipo: | String |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-Enabled
O estado de alerta do azure - valores válidos - $true, $false
Tipo: | Boolean |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-InputObject
O recurso Regra de Consulta Agendada
Tipo: | PSScheduledQueryRuleResource |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | True |
Aceitar carateres universais: | False |
-Location
O local para este alerta
Tipo: | String |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-Name
O nome do alerta
Tipo: | String |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-ResourceGroupName
O nome do grupo de recursos
Tipo: | String |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-ResourceId
O ID do recurso
Tipo: | String |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | True |
Aceitar carateres universais: | False |
-Schedule
O agendamento da regra de consulta agendada
Tipo: | PSScheduledQueryRuleSchedule |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-Source
A origem da regra de consulta agendada
Tipo: | PSScheduledQueryRuleSource |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-Tag
Etiquetas de recursos
Tipo: | Hashtable |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-WhatIf
Apresenta o que aconteceria mediante a execução do cmdlet. O cmdlet não é executado.
Tipo: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
Entradas
PSScheduledQueryRuleAlertingAction