简体   繁体   English

如何使用 azure CLI 检查 Loganalytic alertrule 是否存在

[英]How to check the existance of a Loganalytic alertrule using azure CLI

Is there any way to check the existance of a Loganalytic rule by the alertrulename using Az commands or shell script.有什么方法可以使用 Az 命令或 shell 脚本通过 alertrulename 检查 Loganalytic 规则是否存在。 Looking for some solution where I can check whether the given alertrule name in Azuredevops pipeline runtime paramenter is existing in Azure, if existing skip and if not existing create the alert rule.寻找一些解决方案,我可以检查 Azuredevops 管道运行时参数中给定的警报规则名称是否存在于 Azure 中,如果存在则跳过,如果不存在则创建警报规则。

You can view all the log alerts in a resource group using the following command:您可以使用以下命令查看资源组中的所有日志警报:

az monitor scheduled-query list -g {ResourceGroup}

For more info please refer Manage log alerts using CLI .有关详细信息,请参阅使用 CLI 管理日志警报

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure 工作流无法连接到 LogAnalytic - Azure workflow can not connect to LogAnalytic 如何使用 azure cli 和 rest 命令清除设置? - How to clear settings using azure cli and rest command? 如何使用 Azure CLI 从特定的 Azure 存储帐户获取所有容器? - How to Get All the Containers From a Specific Azure Storage Account using Azure CLI? 如何使用应用程序注册和 azure cli 命令获取所有 azure 应用程序注册并查看机密的到期日期? - How to get all azure app registrations and view expiry date of secrets using a app registrations and azure cli commands? azure cli - 使用 python 进行 JMESPath 查询 - azure cli - JMESPath querying using python 使用 Azure CLI 获取 Azure 应用程序网关的“principalId”值 - Using Azure CLI Get the 'principalId' value of an Azure Application Gateway 如何使用 ARM 或 Azure CLI 将现有的 virtual.netwrok 连接到开发测试实验室? - How to connect an existing virtual netwrok to DevTest lab using ARM or Azure CLI? 使用 azure cli 获取 Azure API 管理订阅密钥 - Fetch Azure API Management subscription key using azure cli 无法使用 Azure CLI 查询 Azure 表存储 - Unable to query Azure Table Storage using Azure CLI 在 azure windows webapp 中使用 azure cli 设置 do.net 核心版本 - set dotnet core version using azure cli in azure windows webapp
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM