我有一个应用程序,它使用AzureFunction和EventGrid和NodeJS.我想在本地主机中调试一些事件触发器函数,但出于特殊原因,我不想使用Ngrok.没有Ngrok,还有其他方法可以实现EventGrid调试吗?
我有一个应用程序,它使用AzureFunction和EventGrid和NodeJS.我想在本地主机中调试一些事件触发器函数,但出于特殊原因,我不想使用Ngrok.没有Ngrok,还有其他方法可以实现EventGrid调试吗?
在本地运行Azure函数时,可以通过以下URL访问EventGridTrigger:
http://localhost:7071/runtime/webhooks/EventGrid?functionName={functionname}
例如,从postman (例如),您将需要以下附加标头:
application/json
.Notification
.完整的http请求如下所示
POST /runtime/webhooks/EventGrid?functionName={functionname}
Host: http://localhost:7071
Content-Type: application/json
aeg-event-type: Notification
{
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourcegroups/test/providers/Microsoft.EventHub/namespaces/test",
"subject": "eventhubs/test",
"eventType": "captureFileCreated",
"eventTime": "2017-07-14T23:10:27.7689666Z",
"id": "7b11c4ce-1c34-4416-848b-1730e766f126",
"data": {
"fileUrl": "https://test.blob.core.windows.net/debugging/testblob.txt",
"fileType": "AzureBlockBlob",
"partitionId": "1",
"sizeInBytes": 0,
"eventCount": 0,
"firstSequenceNumber": -1,
"lastSequenceNumber": -1,
"firstEnqueueTime": "0001-01-01T00:00:00",
"lastEnqueueTime": "0001-01-01T00:00:00"
},
"dataVersion": "",
"metadataVersion": "1"
}