Soenneker.Controllers.Alerts
4.0.861
Prefix Reserved
dotnet add package Soenneker.Controllers.Alerts --version 4.0.861
NuGet\Install-Package Soenneker.Controllers.Alerts -Version 4.0.861
<PackageReference Include="Soenneker.Controllers.Alerts" Version="4.0.861" />
<PackageVersion Include="Soenneker.Controllers.Alerts" Version="4.0.861" />
<PackageReference Include="Soenneker.Controllers.Alerts" />
paket add Soenneker.Controllers.Alerts --version 4.0.861
#r "nuget: Soenneker.Controllers.Alerts, 4.0.861"
#:package Soenneker.Controllers.Alerts@4.0.861
#addin nuget:?package=Soenneker.Controllers.Alerts&version=4.0.861
#tool nuget:?package=Soenneker.Controllers.Alerts&version=4.0.861
Soenneker.Controllers.Alerts
Adds an MVC endpoint that accepts Azure Monitor common alert schema payloads and forwards them to IAlertsCoordinator.
Install
dotnet add package Soenneker.Controllers.Alerts
Register the controller and coordinator
using Soenneker.Controllers.Alerts;
using Soenneker.Coordinators.Alerts.Registrars;
builder.Services
.AddControllers()
.AddApplicationPart(typeof(AlertsController).Assembly);
builder.Services.AddAlertsCoordinatorAsSingleton();
The coordinator requires these application settings in addition to the Microsoft Teams settings used by Soenneker.MsTeams.Util:
{
"Api": {
"Alerts": {
"AzureApiKey": "replace-with-a-random-secret"
}
},
"Environment": "Production"
}
Endpoint
POST /alerts/azure?apiKey=<secret>
Content-Type: application/json
The body is a CasRequest from Azure Monitor's common alert schema.
| Response | Meaning |
|---|---|
201 Created |
The coordinator accepted and forwarded the alert |
400 Bad Request |
The payload did not contain the required alert data |
The controller is excluded from API Explorer and marked AllowAnonymous; the configured API key is its application-level credential. Authentication failure is surfaced by the coordinator through the application's exception handling.
Security and operation
- Azure Monitor's ordinary webhook model commonly places a token in the callback URL. Query strings are frequently captured by gateways, access logs, traces, and deployment state. Use HTTPS, redact the
apiKeyquery value throughout the request path, rotate it when exposed, and never place the callback URL in source control. - For stronger authentication, prefer an Azure Monitor Secure Webhook protected by Microsoft Entra ID and an application endpoint configured for bearer authentication. That requires host-level authentication rather than this controller's static-key coordinator contract.
- Cancellation is forwarded to the coordinator and Microsoft Teams delivery. It does not undo a message already accepted by the downstream service.
- API version
1is declared through ASP.NET API Versioning; the host determines whether versions are selected by query string, header, media type, or another configured reader.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Soenneker.Controllers.Base (>= 4.0.86)
- Soenneker.Coordinators.Alerts (>= 4.0.1039)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.861 | 189 | 10/15/2026 |
| 4.0.860 | 134 | 10/15/2026 |
| 4.0.859 | 96 | 10/15/2026 |
| 4.0.858 | 82 | 10/15/2026 |
| 4.0.857 | 87 | 10/14/2026 |
| 4.0.856 | 84 | 10/14/2026 |
| 4.0.855 | 84 | 10/14/2026 |
| 4.0.853 | 86 | 10/14/2026 |
| 4.0.852 | 86 | 10/14/2026 |
| 4.0.851 | 100 | 10/14/2026 |
| 4.0.845 | 105 | 10/13/2026 |
| 4.0.844 | 91 | 10/12/2026 |
| 4.0.841 | 92 | 10/12/2026 |
| 4.0.840 | 114 | 10/11/2026 |
| 4.0.839 | 104 | 10/11/2026 |
| 4.0.838 | 110 | 10/11/2026 |
| 4.0.837 | 95 | 10/11/2026 |
| 4.0.836 | 114 | 10/10/2026 |
| 4.0.835 | 105 | 10/10/2026 |
| 4.0.834 | 134 | 10/6/2026 |
Update dependency Soenneker.Coordinators.Alerts to 4.0.1039 (#1427)