Azure Monitor, Azure Automation (Runbooks)을 사용하여 App Service (PaaS)의 모니터링 알림 대상 (Webhook)을 Chatwork로 만들기
PaaS의 감시 통지처를 Chatwork로 하고 싶다! !
그래서
Azure Monitor + Azure Automation (Runbooks)을 사용하여 Chatwork에 알립니다.
할 일
필요하지만 이번 절차로는 쓰지 않는 것
할 일의 이미지 다이어그램

절차 개요
절차
1.Automation 계정 생성
Azure Portal 로그인 후 Automation 화면에서 추가 또는 Automation 계정 만들기를 누릅니다.

각 항목을 입력하고 만들기.

Automation 계정을 만들었습니다.

2.Runbooks 만들기
Automation 계정 화면으로 이동합니다.

Runbook 추가를 누릅니다.

런북의 이름과 유형을 입력하고 만들기.
※종류는 [PowerShell Runbook]로 했습니다.

Runbook을 만들었습니다. 만든 Runbook을 선택합니다.

편집을 합니다.

Chatwork에 알리기 위한 Powershell을 기재하고 저장합니다.

##roomid is chatwork room id
$roomid = chatwork room ID
##$headers is hws-chatwork user zabbix
$headers = @{"X-ChatWorkToken" = "chatwork API token"}
##$notification is a message content
$notification = 'body=[info][title]HTTP Server Error in WebApps!![/title][toall]
An error occurred in WebApps.
Service Name: App Service
Resource Name:
Error: HTTP Server Error
Please check your website.
[/info]'
##notificate to chatwork
Invoke-RestMethod -Uri "https://api.chatwork.com/v2/rooms/$roomid/messages" -Method POST -Headers $headers -Body $notification
저장된 Runbook을 게시합니다.

런북 상태가 새로 만들기에서 게시됨으로 변경되었습니다.
※공개를 하지 않으면 Webhook의 설정을 할 수 없었습니다.

3.Webhook 설정
만든 Runbook 화면에서 Webhook 추가를 수행합니다.

Webhook의 이름을 입력하고 URL을 복사하고 메모한 다음 확인을 누릅니다.
※여기서 URL을 메모하지 않으면 URL을 다시 확인할 수 없기 때문에 Azure Monitor에서 설정할 수 없게 되어 버립니다! !

Chatwork에 알릴 수 있는지 확인하려면 시작을 누릅니다.

예를 누릅니다.

이제 다음과 같이 Runbook에 설정한 룸 ID를 가진 채팅 작업에 알릴 것입니다!

4. Azure Monitor 설정
AppService 화면에서 메트릭 알림 추가(클래식)를 수행합니다.

알림 수단의 Webhook에 3단계에서 기록한 URL을 붙이고 OK를 누릅니다.

이런 느낌이 되면 OK입니다!
Reference
이 문제에 관하여(Azure Monitor, Azure Automation (Runbooks)을 사용하여 App Service (PaaS)의 모니터링 알림 대상 (Webhook)을 Chatwork로 만들기), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/takahashi-kazuki/items/d84a03fd9a522056b76c
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
##roomid is chatwork room id
$roomid = chatwork room ID
##$headers is hws-chatwork user zabbix
$headers = @{"X-ChatWorkToken" = "chatwork API token"}
##$notification is a message content
$notification = 'body=[info][title]HTTP Server Error in WebApps!![/title][toall]
An error occurred in WebApps.
Service Name: App Service
Resource Name:
Error: HTTP Server Error
Please check your website.
[/info]'
##notificate to chatwork
Invoke-RestMethod -Uri "https://api.chatwork.com/v2/rooms/$roomid/messages" -Method POST -Headers $headers -Body $notification
Reference
이 문제에 관하여(Azure Monitor, Azure Automation (Runbooks)을 사용하여 App Service (PaaS)의 모니터링 알림 대상 (Webhook)을 Chatwork로 만들기), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/takahashi-kazuki/items/d84a03fd9a522056b76c텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)