Following receiving my MVP Award last month, I really wanted to go to the Microsoft MVP Summit in Redmond next year . However, the number of seats for In-Person attendance is limited, and you never actually know when registration opens – until it does.
I decided this was a great opportunity for me to test the Azure OpenAI services. The idea was to get the HTML body of the website which announces registration and make GPT parse the text and respond whether registration was open or not.
Azure Functions was a perfect fit for this. A Flex Consumption app that runs every 5 minutes with a timer trigger is one of the easiest things in the world to setup, and it has a very low cost.
Finally, I needed some way to get notified when registration opens. I considered using Azure Communication Services to send me a text message or a call, but it was too much of a hassle for this small project, as you need to register a phone number with a provider and pay for that number.
Instead, I remembered that Home Assistant offers webhooks for automations, and since I have a Home Assistant Server at home and the Home Assistant companion app on my phone, that was a perfect match for this use case.
The Azure Function
The function runs on a timer every 5 minutes and performs the following steps:
- Download HTML from the summit page
- Run a fast keyword check (just because you can)
- If inconclusive, call Azure OpenAI to classify the body content as OPEN or CLOSED
- If OPEN, trigger a Home Assistant webhook which drives a mobile notification
Prerequisites
- Azure OpenAI resource + deployed model (I used
gpt-5-mini) - Function App (or local Function Core Tools) targeting .NET 8 isolated worker
- Configured environment variables:
AZURE_OPENAI_ENDPOINT,AZURE_OPENAI_KEY,AZURE_OPENAI_DEPLOYMENT - Home Assistant instance with an automation webhook URL and public access (I use Nabu Casa)
- You must add the Azure.AI.OpenAI NuGet package to your project
Heuristic check
The heuristic avoids an AI call when obvious registration phrases exist. These were just a guess from my side and you could put in anything in here.
private bool HeuristicCheck(string html)
{
var lowered = html.ToLowerInvariant();
var indicators = new[]
{
"register now",
"registration open",
"register today",
"sign up"
};
return indicators.Any(p => lowered.Contains(p));
}Azure OpenAI classification
First, setup an AzureOpenAIClient. I did it in Program.cs:
builder.Services.AddSingleton(sp => new AzureOpenAIClient(
new Uri(Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT")),
new AzureKeyCredential(Environment.GetEnvironmentVariable("AZURE_OPENAI_KEY"))));<body> section is sent, which reduces token usage:
private async Task<bool> DetermineRegistrationOpenAsync(string html, CancellationToken ct)
{
if (HeuristicCheck(html)) return true;
if (MissingOpenAiConfig()) return false;
var body = ExtractBodyContent(html) ?? html;
var chatClient = azureOpenAIClient.GetChatClient(_openAiDeployment);
var messages = new List<ChatMessage>
{
new SystemChatMessage("You classify event registration state based on HTML body content. Reply only with OPEN or CLOSED."),
new UserChatMessage(body)
};
var response = await chatClient.CompleteChatAsync(messages, ct);
var answer = response.Value.Content.First().Text.Trim().ToUpperInvariant();
return answer == "OPEN";
}Webhook notification
When registration is detected as open, a JSON POST to the Home Assistant webhook triggers a mobile push notification:
private async Task TriggerWebhookAsync(CancellationToken ct)
{
var payload = new { message = "Microsoft Summit registration appears OPEN.", url = SummitUri.ToString(), detectedAtUtc = DateTime.UtcNow };
using var response = await _httpClient.PostAsJsonAsync(WebhookUri, payload, ct);
if (!response.IsSuccessStatusCode)
_logger.LogWarning("Webhook call failed: {Status}", response.StatusCode);
}Configuration (local.settings.json)
{
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"AZURE_OPENAI_ENDPOINT": "https://<your-openai-resource>.openai.azure.com/",
"AZURE_OPENAI_KEY": "<key>",
"AZURE_OPENAI_DEPLOYMENT": "gpt-5-mini"
}
}The Home Assistant automation
Create a new automation using the Webhook trigger. Here is my source:
alias: Summit registration
description: ""
triggers:
- trigger: webhook
allowed_methods:
- POST
- PUT
local_only: false
webhook_id: summit-registration-OMITTED
conditions: []
actions:
- device_id: OMITTED
domain: mobile_app
type: notify
title: Summit registration open!
message: Registration is open
data:
actions:
- action: URI
title: Open Url
uri: https://summit.microsoft.com/en-us/
mode: singleSecurity notes
- Webhook URL should be treated as a secret.
Final notes
- Most of my code was written with GitHub copilot in Agent mode with GPT-5
- My costs to run this for a few days, including the Azure AI Foundry containing the gpt-5-mini model, added up to ~0.1 USD per day. And since it was announced one week ahead that registration would open some time this week, it added up to less than $1 to have this running for me.