如何跟踪 failed/expired 天蓝色事件网格传递消息?

How to track failed/expired azure event grid delivery message?

很高兴看到 azure 事件网格有一个 24 小时重试策略,该策略具有指数回退,以实现 99.99% 的可用性。但是,我遇到过这样一种情况,即预期的事件网格消息之一在 24 小时后仍未到达。

我为主题为 /subscriptions/id/resourcegroups/name/providers/Microsoft.Resources/deployments/name 的事件配置了一个 Web 挂钩,我希望它在资源组部署完成后完成,正如我从 Azure 门户中看到的那样,它已成功完成。

你能帮忙澄清一下下面的问题吗,

  1. 要检查是否尝试了 24 小时重试,我在哪里可以找到日志
  2. 如果尝试并重试失败,我在哪里可以找到日志
  3. 如果由于事件网格故障或不可用而导致即使消费者可用也没有进行交付,我在哪里可以找到日志

就像 Sean 的评论中提到的那样,这种支持即将到来。

基于 Microsoft.Azure.Management.EventGrid,Version=2.0.0.0 我们可以期待一个新的 属性 例如 deadletterdestination 在事件订阅中,请参阅以下用于创建或更新订阅的示例有效负载片段:

    {
      "properties": {
        "deadletterdestination": {
          "endpointType": "StorageBlob",
          "properties": {
            "blobContainerName": "{myContainerName}",
            "resourceId": "/subscriptions/{mySubscriptionId}/resourceGroups/{myResourceGroup}/providers/Microsoft.Storage/storageAccounts/{myStorageAccount}"
          }
        },
        "destination": {
          "endpointType": "WebHook",
          "properties": {
          "endpointUrl": "{myEndpointUrl}"
          }
        },
        "filter": {
          "isSubjectCaseSensitive": false,
          "subjectBeginsWith": null,
          "subjectEndsWith": null
        },
        "labels": ["xxx"],
        "eventDeliverySchema": "InputEventSchema",
        "retryPolicy": {
         "maxDeliveryAttempts": 30,
         "eventTimeToLiveInMinutes": 1440
        }
      }
    }

当您发出 REST 请求(api-version=2018-05-01-preview)以使用上述负载创建事件订阅时,响应失败并显示以下消息:

    {
      "error": {
        "code": "InvalidRequest",
        "message": "DeadLettering is currently not enabled in the service and support for it is coming soon. Until then, please re-issue the event subscription creation/update request without setting a deadletter destination."
    }
  }

我很期待这个很棒的功能,每个订阅都可以成为死信事件的来源,我希望会有更多的死信目的地端点类型,例如 EventHub、StorageQueue、ServiceBus、WebHook 等。

更新:

感谢 azure 事件网格团队发布 deadletterdestination 功能的预览。现在,每个订阅都可以决定何时可以发送死信。今天我们可以将它发送到存储 blob。

以下屏幕片段显示了存储在 blob 存储中的死信:

查看更多详情here