A TimeTrigger Azure function which lets the user monitor different weather conditions and notify if these exceed a specified threshold value.
It can also be triggered manually with the /manual endpoint
This function needs an AlarmConfig.json file stored in a blob storage in the Azure portal.
An example of the AlarmConfig.json can be found below.
This function requires some environment variables to work which will differ from user to user:
- SLACK_KEY - URL to Slack workflow. Should be setup as a secret
- MET_USER_AGENT - See MET API Terms of Service
- BLOB_URI - See Blog Storage section
- BLOB_CONTAINER - See Blog Storage section
- BLOB_NAME - See Blog Storage section
ForecastSchedule- TimeTrigger Cron tab
You need to setup a workflow with a webhook containing a data variable named my_message.
The function currently only support ONE notification channel, which is Slack.
The AlarmConfig.json is where you setup the alarms for the different locations you want to monitor.
The function currently supports two alarm types: Wind and Tidal.
Notify when the forecast exceeds the MaxWindSpeed threshold value. It can be further specified with one or more wind directions.
Notify when the forecast exceeds the MaxWaterLevels threshold value
{
"Locations": [
{
"Latitude": "59.9139",
"Longitude": "10.7522",
"LocationName": "Oslo",
"Alarms": [
{
"AlarmClass": "TidalClass",
"AlarmType": "Tidal",
"Name": "Oslo - High sea level",
"MaxWaterLevels": 300
},
{
"AlarmClass": "WindClass",
"AlarmType": "Wind",
"Name": "Oslo - Strong wind",
"MaxWindSpeed": 25
}
]
},
{
"Latitude": "60.3913",
"Longitude": "5.3221",
"LocationName": "Bergen",
"Alarms": [
{
"AlarmClass": "WindClass",
"AlarmType": "Wind",
"Name": "Bergen - String wind (S, W, SW)",
"MaxWindSpeed": 25,
"Directions": [
"South",
"West",
"SouthWest"
]
}
]
}
]
}
MIT License
Copyright © 2025 - Christian Johansen