简体   繁体   English

如果 Azure 应用服务实例失败,如何触发 PowerShell 脚本

[英]How to trigger PowerShell script if Azure App service instance fails

Hi I have PowerShell script which grabs azure app service instances one by one and invokes URLS.嗨,我有 PowerShell 脚本,它一一抓取 azure 应用服务实例并调用 URL。 I run this script using azure devops.我使用 azure devops 运行此脚本。

I want my scripts to get triggered every time if any of app service instance gets sick and gets replaced It should run the script again for New App service instance如果任何应用程序服务实例生病并被替换,我希望我的脚本每次都被触发它应该为新的应用程序服务实例再次运行脚本

I don't know how to trigger script in real time, I tried to search which landed me to azure automation runbook but did not find anything for app instance failure.我不知道如何实时触发脚本,我尝试搜索将我引导到 azure 自动化运行手册,但没有找到任何应用程序实例失败的内容。

Thanks谢谢

Use Azure Monitor Rules.使用 Azure 监控规则。 This will monitor health of your app and trigger action of your choice when something will be not ok.这将监控您的应用程序的运行状况,并在出现问题时触发您选择的操作。 Add a condition with HealtCheck:使用 HealthCheck 添加条件:

在此处输入图像描述

Then assign action group that triggers Azure Funcion with powershell script.然后使用 powershell 脚本分配触发 Azure 功能的操作组。

在此处输入图像描述

Ref: https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-log参考: https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-log

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

相关问题 Azure Powershell脚本,用于交换Azure App Service(网站)部署插槽 - Azure Powershell script to swap Azure App Service (website) deployment slots 如何重新启动 Azure 应用服务实例 - How to restart Azure App Service Instance 如何关闭 azure 中的一个应用服务实例 - How to shutdown one instance of an app service in azure 如何在运行 Linux 的 Azure 应用服务上运行 PowerShell 脚本? - How do I run a PowerShell script on an Azure App Service running Linux? Azure Devops - 如何在部署后的应用服务上运行 powershell 脚本? - Azure Devops - How to run a powershell script on an App Service post-deploy? 如何使用Azure Powershell创建Azure App服务? - How to create azure app service using azure powershell? 如果 Azure 服务总线队列触发器功能失败,如何将队列消息返回到 Azure 服务总线队列 - How to return queue message to Azure Service Bus Queue if Azure Service Bus Queue Trigger Func Fails 如何在 Azure App Service Linux 上运行脚本 - How Run script on Azure App Service Linux 使用 Powershell 升级 Azure 应用服务 - Upgrade Azure App Service with Powershell Azure App Service扩展Powershell - Azure App Service Scaling powershell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM