Azure functions 如何查看实际的Azure事件网格消息?
我有一个由Azure functions 如何查看实际的Azure事件网格消息?,azure-functions,azure-eventgrid,Azure Functions,Azure Eventgrid,我有一个由EventGridEvents触发的Azure函数 function.json相应设置: \uuuu init\uuuuu.py拨入(此处仅显示片段): 函数已成功部署 已成功创建EventGrid触发器 我在此处成功发布了一条EventGrid消息: 但该功能从未触发 我现在想查看实际的EventGrid消息,并调试函数没有触发的原因,但我找不到查看消息的位置 我等了30分钟,多次刷新,甚至在看AppInsights的实时日志,没有触发 成功发布EventGrid
EventGridEvents
触发的Azure函数
相应设置:function.json
拨入(此处仅显示片段):\uuuu init\uuuuu.py
- 函数已成功部署
- 已成功创建EventGrid触发器
- 我在此处成功发布了一条
消息:EventGrid
- 但该功能从未触发
EventGrid
消息,并调试函数没有触发的原因,但我找不到查看消息的位置
我等了30分钟,多次刷新,甚至在看AppInsights的实时日志,没有触发
EventGrid
消息后,我在何处查看该消息我做了一个测试。就我而言,这似乎没有问题 也许你的和我的有所不同 请检查:
\u init.py
import json
import logging
import azure.functions as func
def main(event: func.EventGridEvent):
result = json.dumps({
'id': event.id,
'data': event.get_json(),
'topic': event.topic,
'subject': event.subject,
'event_type': event.event_type,
})
logging.info('Python EventGrid trigger processed an event: %s', result)
{
"scriptFile": "__init__.py",
"bindings": [
{
"type": "eventGridTrigger",
"name": "event",
"direction": "in"
}
]
}
function.json
import json
import logging
import azure.functions as func
def main(event: func.EventGridEvent):
result = json.dumps({
'id': event.id,
'data': event.get_json(),
'topic': event.topic,
'subject': event.subject,
'event_type': event.event_type,
})
logging.info('Python EventGrid trigger processed an event: %s', result)
{
"scriptFile": "__init__.py",
"bindings": [
{
"type": "eventGridTrigger",
"name": "event",
"direction": "in"
}
]
}
这是我的eventgrid订阅:(我向特定容器添加一个blob并将其删除。请注意,eventgrid订阅的度量可能需要大约5分钟才能显示。但它会立即触发端点函数。)
这是我的eventgrid订阅的筛选器:
我希望在测试容器中创建和删除blob以触发endpoint azure函数,因此我将/blobServices/default/containers/test
添加到“主题以开头”部分
那么我的函数就可以正常工作了:
您是否遵循以下教程?因为您的问题似乎是您的函数没有监视正确的Eventhub,所以消息或函数名是错误的。谢谢@BowmanZhu,这很有帮助。我的主要问题是,在哪里可以查看已发送的事件网格消息?我可以在Azure Portal的何处查看历史事件消息?