microsoft/skills

azure-eventgrid-dotnet

先选事件格式与投递模式,再处理事件结算

  • SKILL.md 已保存
  • 中文用法已整理
  • 安装与运行未实测
先判断是否解决你的问题

azure-eventgrid-dotnet 是什么?

azure-eventgrid-dotnet 区分Topic/Domain的EventGridPublisherClient和Namespace的Sender/Receiver,支持CloudEvent与EventGridEvent。适合C#事件路由接入,拉取消费时依据lock token决定acknowledge、release或reject。

中文说明由本站依据来源整理;英文原文保留在页面下方。

按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 azure-eventgrid-dotnet,然后按本页使用示例提供材料。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 azure-eventgrid-dotnet

请在 Codex 的当前工作环境中安装并检查 azure-eventgrid-dotnet 这个 Skill。

项目身份:microsoft/skills / azure-eventgrid-dotnet
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-dotnet/skills/azure-eventgrid-dotnet/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-dotnet/skills/azure-eventgrid-dotnet/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
准备输入,再按步骤执行

装好以后,具体怎么用?

准备哪些材料

  • 按推送或Namespace拉取选择对应NuGet包,另补实际身份依赖;准备准确endpoint、topic/subscription和发布/接收权限,明确CloudEvents或Event Grid schema。

会得到什么

  • C#发布或拉取接入代码、事件schema映射与逐项结算规则。

实际使用顺序

  1. Publisher发送的事件格式必须匹配topic;Domain路由按源给事件指定Topic。事件ID、type、subject与dataVersion保持业务含义,不把每次重试都变新ID当自动去重。
  2. Namespace用独立Sender/Receiver客户端,接收后保留每项lock token,业务成功才ack,可恢复失败release,不可处理项按配置reject;检查结算返回的失败项。
  3. 解析webhook时按真实schema反序列化并校验业务字段;Azure Functions的in-process与isolated示例是不同宿主,依赖与入口不能拼接。401/403/413分别判断,不因任何RequestFailedException都盲目切区重发。
使用示例

从一个具体任务开始

本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。

安装并识别 Skill 后发送

复制一个具体任务

教学任务:使用 azure-eventgrid-dotnet,为Namespace订单topic/subscription设计拉取消费:成功项ack,可恢复失败release,坏格式项记录后按已配置策略reject。检查每项结算返回结果,按event id去重;只写代码,不接收或发送事件。
预期结果

预期得到投递模式与结算明确的C#方案;本站未连接Event Grid。

使用前先看这些限制

使用条件与边界

  • reject不自动保证已有死信存储,是否进入配置的承接目的地需单独核对。
  • 发布返回成功只是服务接收,不证明订阅端业务完成;源中跨区failover片段不能作为无重复投递保证。
针对这个 Skill 的疑问

常见问题

Topic发布成功为什么还不能说处理成功?

发布端只知道服务接收结果,后续路由、订阅投递和业务执行有各自状态。需要接收端证据,不能用send成功替代。

需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
中文使用说明
已针对下方源文件版本整理用途、用法和常见问题
安装与任务测试
本站未执行安装或任务测试
来源复核
本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料

.github/plugins/azure-sdk-dotnet/skills/azure-eventgrid-dotnet/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Azure Event Grid SDK for .NET. Client library for publishing and consuming events with Azure Event Grid. Use for event-driven architectures, pub/sub messaging, CloudEvents, and EventGridEvents. Triggers: "Event Grid", "EventGridPublisherClient", "CloudEvent", "EventGridEvent", "publish events .NET", "event-driven", "pub/sub".

查看源文件章节 / Source sections
  • 原文:Azure.Messaging.EventGrid (.NET)
  • 安装 / Installation
  • 原文:Environment Variables
  • 原文:Client Hierarchy
  • 原文:Authentication
  • 原文:API Key Authentication
  • 原文:Microsoft Entra Token Credential
  • 原文:SAS Token Authentication
  • 原文:Publishing Events
  • 原文:EventGridEvent Schema
  • 原文:CloudEvent Schema
  • 原文:Publishing to Event Grid Domain
  • 原文:Custom Serialization
  • 原文:Pull Delivery (Namespaces)
  • 原文:Send Events to Namespace Topic
  • 原文:Receive and Process Events
  • 原文:Reject Events (Dead Letter)
  • 原文:Consuming Events (Azure Functions)
  • 原文:EventGridEvent Trigger
  • 原文:CloudEvent Trigger
  • 原文:Parsing Events
  • 原文:Parse EventGridEvent
  • 原文:Parse CloudEvent
  • 原文:System Events
  • 原文:Key Types Reference
  • 原文:Event Schemas Comparison
  • 原文:Best Practices
  • 原文:Error Handling
  • 原文:Failover Pattern
  • 原文:Related SDKs
原文:Azure.Messaging.EventGrid (.NET)

Client library for publishing events to Azure Event Grid topics, domains, and namespaces.

安装 / Installation

```bash # For topics and domains (push delivery) dotnet add package Azure.Messaging.EventGrid # For namespaces (pull delivery) dotnet add package Azure.Messaging.EventGrid.Namespaces # For CloudNative CloudEvents interop dotnet add package Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents ``` **Current Version**: 4.28.0 (stable)

原文:Environment Variables

```bash EVENT_GRID_TOPIC_ENDPOINT=https://<topic-name>.<region>.eventgrid.azure.net/api/events # Required: Event Grid topic or domain endpoint EVENT_GRID_TOPIC_KEY=<access-key> # Only required for AzureKeyCredential auth EVENT_GRID_NAMESPACE_ENDPOINT=https://<namespace>.<region>.eventgrid.azure.net # Optional: Event Grid namespace endpoint EVENT_GRID_TOPIC_NAME=<topic-name> # Required: Event Grid topic name EVENT_GRID_SUBSCRIPTION_NAME=<subscription-name> # Optional: Event Grid subscription name AZURE_TOKEN_CREDENTIALS=prod # Required only if DefaultAzureCredential is used in production ```

原文:Client Hierarchy

``` Push Delivery (Topics/Domains) └── EventGridPublisherClient ├── SendEventAsync(EventGridEvent) ├── SendEventsAsync(IEnumerable<EventGridEvent>) ├── SendEventAsync(CloudEvent) └── SendEventsAsync(IEnumerable<CloudEvent>) Pull Delivery (Namespaces) ├── EventGridSenderClient │ └── SendAsync(CloudEvent) └── EventGridReceiverClient ├── ReceiveAsync() ├── AcknowledgeAsync() ├── ReleaseAsync() └── RejectAsync() ```

原文:API Key Authentication

```csharp using Azure; using Azure.Messaging.EventGrid; EventGridPublisherClient client = new( new Uri("https://mytopic.eastus-1.eventgrid.azure.net/api/events"), new AzureKeyCredential("<access-key>")); ```

原文:Microsoft Entra Token Credential

```csharp using Azure.Identity; using Azure.Messaging.EventGrid; // Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential> var credential = new DefaultAzureCredential( DefaultAzureCredential.DefaultEnvironmentVariableName ); // Or use a specific credential directly in production: // See https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#credential-classes // var credential = new ManagedIdentityCredential(); EventGridPublisherClient client = new( new Uri("https://mytopic.eastus-1.eventgrid.azure.net/api/events"), credential); ```

文件 SHA256:898e9dd9acece95418989c09e3e9824fbe81c8ecb3bb4279003edff334f63e24

仓库许可证记录:MIT;skill-declaration-captured-not-interpreted,查看来源。

SKILL.md原文description · 2026-11-16T12:36:35.145Z

Azure Event Grid SDK for .NET. Client library for publishing and consuming events with Azure Event Grid. Use for event-driven architectures, pub/sub messaging, CloudEvents, and EventGridEvents. Triggers: "Event Grid", "EventGridPublisherClient", "CloudEvent", "EventGridEvent", "publish events .NET", "event-driven", "pub/sub".

查看历史简介来源

历史收录数据

来源仓库microsoft/skills
Skill源路径.github/plugins/azure-sdk-dotnet/skills/azure-eventgrid-dotnet/SKILL.md

安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源