使用ARM模板的具有静态Header的WEBOOK类型的事件订阅



问题区域

我尝试根据官方文档使用ARM模板创建一个新的事件网格主题订阅。

脚本在PowerShell终端中运行良好,但在azure门户中找不到在指定主题下生成的事件订阅。

示例JSON模板

{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.EventGrid/eventSubscriptions",
"apiVersion": "2021-06-01-preview",
"name": "Subscription_1",
"properties": {
"destination": {
"topic": "/subscriptions/{Subscription Id})/resourceGroups/{Resource group name}/providers/Microsoft.EventGrid/topics/{Topic name}}",
"endpointType": "WebHook",
"properties": {
"endpointUrl": "{Endpoint URL}",
"deliveryAttributeMappings": [
{
"name": "test",
"type": "Static",
"properties": {
"value": "test"
}
}
]
}
},
"eventDeliverySchema": "EventGridSchema",
"filter": {
"advancedFilters": [],
"enableAdvancedFilteringOnArrays": true
},
"labels": []      
}
}
]
}

解决方案

通过更改arm模板中的"类型"one_answers"命名约定",如下所示:

"type": "Microsoft.EventGrid/topics/providers/eventSubscriptions",
"apiVersion": "2021-06-01-preview",
"name": "{Topic Name}/ Microsoft.EventGrid/ {Subsctription Name}",

最新更新