开始使用免费开始使用

通过 Event Grid 触发 Azure Function

Cipher Coffee 希望在每次有新 blob 上传时,立即运行下游自动化流程。您将把 Azure Event Grid 连接到一个预先创建的 Azure Function,使其在 blob 创建时被直接调用,并验证该函数能够接收到事件负载。

本练习是课程的一部分

面向 Azure Storage 的开发

查看课程

练习说明

在您的 Function App 中添加一个名为 "OnBlobCreated" 的 Azure Event Grid trigger 函数。,在名为 "blob-created-to-function" 的存储帐户上创建一个 Event Subscription,将 System Topic Name 设为 "function-events-topic",目标为 "OnBlobCreated" 函数,并仅筛选 Blob Created 事件类型。,创建名为 "events-in" 的容器并上传一个 blob 以触发事件。,在 Monitor 中确认函数调用出现,日志显示 Microsoft.Storage.BlobCreatedScreenshot showing an Event Grid subscription on a Storage account targeting an Azure Function endpoint named OnBlobCreated, plus a successful function invocation in Monitor with eventType Microsoft.Storage.BlobCreated.

动手互动练习

通过我们的互动练习之一,将理论转化为实践

开始练习