如前所述,我们可以使用 Azure CLI 通过存储队列订阅事件网格主题:
az eventgrid event-subscription create \
--topic-name demotopic \
-g myResourceGroup \
--name eventsub1 \
--endpoint-type storagequeue \
--endpoint <storage-queue-url>
使用 Microsoft.Azure.Management.EventGrid 时:
EventSubscription eventSubscription = new EventSubscription()
{
Destination = new WebHookEventSubscriptionDestination()
{
EndpointUrl = endpointUrl
},
// The below are all optional settings
EventDeliverySchema = EventDeliverySchema.EventGridSchema,
Filter = new EventSubscriptionFilter()
{
// By default, "All" event types are included
IsSubjectCaseSensitive = false,
SubjectBeginsWith = "",
SubjectEndsWith = ""
}
};
我没有得到任何属性或方法来设置 CLI 命令中提到的端点类型和端点。
谁能帮助我如何使用 c# nuget 库将端点类型设置为 storagequeue