[英]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.