简体   繁体   中英

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. I run this script using 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.

Thanks

Use Azure Monitor Rules. This will monitor health of your app and trigger action of your choice when something will be not ok. Add a condition with HealtCheck:

在此处输入图像描述

Then assign action group that triggers Azure Funcion with powershell script.

在此处输入图像描述

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM