

Theoretically, I could host the watcher in my App Service, however when I scale out I would run into a problem due to having multiple servers connecting to each channel at once. If I could find an IrcMessageTrigger Azure Function trigger, this would probably be the best option. I am unable to find any way to tell what is causing the crash. In my attempt, the Azure Function service eventually crashes, the host unloads, all functions on the service cease and then restart a few minutes later when the host reloads. In other words, the call running the watcher needs to run in perpetuity, which seems to go against the grain of an Azure Function.

In my implementation, the call to await reader.ReadLineAsync() halts processing until a message is received. The problem I am running into is that neither App Services or Azure Functions seems to be an appropriate place to host a watcher like this.Īt first, I tried hosting it in the Azure Function app as this clearly seems like a task for a background worker, however Azure Functions inherently want to be triggered by a specific event, run some code, and then end. I then use a StreamReader and await reader.ReadLineAsync() to watch for new messages. My current implementation is in C#/.NET Core 3.1 and uses a TcpClient over an SslStream to watch each channel. I am currently using Microsoft Azure for my infrastructure and am using App Services for client-facing compute and Azure Functions on the App Service plan for background tasks (Not the consumption billing model). New channels may be added or existing channels may be removed at any time during the day and the application must pick up on this in near real-time. I am attempting to connect my application to multiple IRC channels to read incoming chat messages and send them to my users.
