Configures Azure Event Grid webhook ingestion in Orchard Core Omnichannel, covering SAS/Entra auth, subscription validation, ACS SMS routing, and troubleshooting.
Ships in crestapps-orchardcore. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an Orchard Core expert. Configure a secure Azure Event Grid webhook for the CrestApps Omnichannel pipeline, most commonly to receive Azure Communication Services (ACS) inbound texts.
CrestApps.OrchardCore.Omnichannel.EventGrid in the web/startup
project and enable CrestApps.OrchardCore.Omnichannel.EventGrid (it depends
only on CrestApps.OrchardCore.Omnichannel).POST ~/api/azure/webhook/eventgrid is anonymous and disables
antiforgery; every request, including the validation handshake, must pass the
SAS key or bearer-token check or it gets 401 Unauthorized.400 Bad Request.CrestApps.OrchardCore.Omnichannel.AzureCommunicationServices
for the outbound providers (see orchardcore-omnichannel).{
"steps": [
{
"name": "Feature",
"enable": [
"CrestApps.OrchardCore.Omnichannel.EventGrid"
],
"disable": []
}
]
}
EventGridOptions is bound from the tenant shell configuration section
CrestApps:Omnichannel:EventGrid. In the application's root appsettings.json
the section sits under the OrchardCore key:
{
"OrchardCore": {
"CrestApps": {
"Omnichannel": {
"EventGrid": {
"EventGridSasKey": "set-from-secrets",
"AADIssuer": "https://sts.windows.net/<tenant-id>/",
"AADAudience": "api://<application-id>",
"AADMetadataAddress": "https://login.microsoftonline.com/<tenant-id>/.well-known/openid-configuration"
}
}
}
}
}
A tenant's own App_Data/Sites/{tenant}/appsettings.json uses the same keys
without the OrchardCore wrapper.
EventGridOptions property | Use |
|---|---|
EventGridSasKey | Fixed-time comparison with the aeg-sas-key request header. |
AADIssuer, AADAudience, AADMetadataAddress | Validate a Microsoft Entra bearer token. All three are required; with only some set, a warning is logged and bearer tokens are rejected (SAS keeps working). |
The SAS key is checked first; a valid bearer token authorizes the request when the SAS check fails.
https://<host>/api/azure/webhook/eventgrid.aeg-sas-key whose value equals EventGridSasKey; Event Grid does not send
it on its own. For Entra delivery, configure token delivery for the same
issuer and audience.Microsoft.EventGrid.SubscriptionValidationEvent handshake is authenticated
too. The endpoint echoes { "validationResponse": "<code>" }; a validation
event without a code gets 400.| Event type | Behavior |
|---|---|
Microsoft.Communication.SMSReceived | Mapped onto the SMS channel and raised as OmnichannelConstants.Events.SmsReceived, the same event Twilio and Telnyx raise, so SMS Automation and the SMS Messaging Channel both act on it. |
Microsoft.Communication.SMSDeliveryReportReceived | Stored as an inbound message and passed to handlers; the sent message's delivery status is not updated. |
| Any other type | Stored as an inbound message (channel Unknown unless the data names one) and passed to every IOmnichannelEventHandler with its raw type. |
ACS inbound text fields map as from to customer address, to to service
address (which selects the SMS omnichannel address, so the number must exist as
one), message to content, messageId to provider message id (event id when
missing), and receivedTimestamp to the created time.
messageId, before Event Grid is answered, and processed as soon as
the response is sent, because an automated reply can outlast Event Grid's
30-second wait. The Provider Webhook Inbox Dispatch background task
finishes a text a restart interrupted, a redelivered messageId is recognized
on every node, and a text that cannot be stored is answered
503 Service Unavailable so Event Grid redelivers the batch.from or to is stored like an unmapped event with a warning.413 Payload Too Large; malformed JSON gets 400.Unmapped events reach every registered IOmnichannelEventHandler. Filter by the
raw event type and validate the provider payload before acting.
using CrestApps.OrchardCore.Omnichannel.Core;
using CrestApps.OrchardCore.Omnichannel.Core.Models;
namespace MyCompany.OrchardCore.Communications;
public sealed class ContosoEventGridHandler : IOmnichannelEventHandler
{
public Task HandleAsync(OmnichannelEvent omnichannelEvent, CancellationToken cancellationToken = default)
{
if (!string.Equals(omnichannelEvent.EventType, "Contoso.Orders.Shipped", StringComparison.Ordinal))
{
return Task.CompletedTask;
}
// omnichannelEvent.Data holds the raw Event Grid data.
return Task.CompletedTask;
}
}
Register it with services.AddScoped<IOmnichannelEventHandler, ContosoEventGridHandler>();
and keep it idempotent because Event Grid delivers at least once.
The endpoint logs one line per event (type and id), then what it did with it:
mapped to SmsReceived (with provider message id and length), delivery report
stored, redelivery of an already stored text ignored (information), a text that
could not be stored in the inbox (error; Event Grid is asked to redeliver),
mapping failure (warning), or no mapping (debug). Logs never
include message text or phone numbers. Watch for 401, 400 and 413 on the
route.
The module has its own meter and activity source, CrestApps.OrchardCore.EventGrid (EventGridTelemetry), because it does not reference the messaging workspace. crestapps.eventgrid.event counts the events deliveries carried by type (subscription_validation, sms_received, sms_delivery_report, other) and result (validated, invalid, accepted, duplicate, busy, failed, stored, malformed). The request itself is measured by ASP.NET Core, and the endpoint puts crestapps.eventgrid.result on the request span. Each event opens a log scope with EventGridEventId and EventType (never the subject, which is a phone number); log event ids are 18400-18449 (18400 validation without a code, 18404 malformed event). ACS delivery reports arriving here are counted only as crestapps.eventgrid.event with type sms_delivery_report and result stored, not on crestapps.messaging.delivery.
Omnichannel/webhook/AzureEventGrid to
api/azure/webhook/eventgrid; update every subscription.SMSReceived events are now routed to the SMS channel instead of only
being stored, so remove custom handlers that duplicated that mapping.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/crestapps-orchardcore:orchardcore-omnichannel-event-gridfrom crestapps-orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin crestapps-orchardcore137 skills in this plugin
/orchardcore-accountsSkill for the CrestApps Orchard Core Accounts module (CrestApps.OrchardCore.Accounts) with its Account Members, Account Team, Account E-mail Domains and Account Locations features. Covers the Account type and AccountPart, the account picker and search, IAccountChildTypeRule, account page sections (AccountPageTabs, AddPageSection, Notes), members and IAccountMemberService, account invitations, the account owner and team picked from staff, e-mail domains, locations with a billing location, the account's billing profile and party members, the Accounts recipe and deployment steps, and the admin menu. Use this skill when requests mention accounts, the businesses or households records belong to, an account page tab, members, invitations, owners, domains or locations. Strong matches include AccountPart, AccountPageTabs, IAccountMemberService, IAccountInvitationService, AccountInvitation, AccountTeamPart, AccountEmailDomainsPart, IAccountEmailDomains, AccountLocationsPart and ManageAccountMembers./orchardcore-accounts-b2bSkill for the CrestApps Orchard Core Accounts B2B module (CrestApps.OrchardCore.Accounts.B2B), business selling on an Account content item. Covers B2BAccountPart and B2BAccount, buyers as account members and ship-to addresses as account locations, terms (deposit, net days, credit limit) through the account-terms tender billed to the account, the account's billing profile, purchase order numbers, quotes, price lists through IBuyerPriceProvider, order limits, approvals and budgets, OCI punchout, the account/business page and API, the PriceLists recipe and deployment steps, the B2BAccounts report source, and the move from the removed Companies module. Use this skill when requests mention B2B, wholesale or business buyers, net terms, purchase orders, price lists, order approvals or punchout. Strong matches include B2BAccountPart, B2BAccount, AccountTerms, AccountTermsTenderProvider, B2BAccountBillingProfileSource, IB2BAccountStore, PriceList, B2BPriceProvider, B2BApprovalService and ManageB2BAccounts.Other plugins' skills for the same job