ARM模板部署-逻辑应用程序到事件网格主题和多订阅调用更多逻辑应用程序



我很难将事件网格订阅、事件网格主题和逻辑应用程序添加到单个ARM模板中。首先,在订阅中,我不能引用同样正在部署的逻辑应用程序的url:

"name": "[concat(parameters('topics_mt_x_eun_ex_rate_egt_name'), '/Microsoft.EventGrid/', parameters('subscription_name'))]",
"type": "Microsoft.EventGrid/topics/providers/eventSubscriptions",
"location": "[parameters('location')]",
"tags": "[parameters('resourceTags')]",
"apiVersion": "2018-01-01",
"properties": {
"destination": {
"endpointType": "WebHook",
"properties": {
"endpointUrl": "[listCallbackUrl(resourceId('Microsoft.Logic/workflows/triggers', parameters('TargetLogicAppName'), 'manual'), '2016-06-01').value]"
}
},
"filter": {
"includedEventTypes": [
"All"
]
}
},
"dependsOn": [
"[parameters('Topics')]",
"[parameters('TargetLogicAppName')]"
]

我收到以下错误:

InvalidRequest:IpFiltering在api版本2019-06-01中不受支持。

所以我的主要问题是,我该如何让它发挥作用?

此外,我满足于在我的主部署模板中运行以上内容,但是否有可能在主逻辑应用程序中链接发布事件网格操作以连接到事件网格主题(它需要SAS令牌和主题url(?

解决了我遇到的两个问题。

设置变量:

"TargetLogicApp": {
"name": "[parameters('workflows_mt_sample_log_name')]",
"resourceId": "[resourceId('Microsoft.Logic/workflows', parameters('TargetLogicAppName'))]",
"triggerId": "[resourceId('Microsoft.Logic/workflows/triggers', parameters('TargetLogicAppName'), 'manual')]"
}

然后在EventGridTopic资源中:

{
"name": "[concat(parameters('topic'), '/Microsoft.EventGrid/', parameters('subscription_name'))]",
"type": "Microsoft.EventGrid/topics/providers/eventSubscriptions",
"location": "[parameters('location')]",
"tags": "[parameters('resourceTags')]",
"apiVersion": "2020-04-01-preview",
"properties": {
"destination": {
"endpointType": "WebHook",
"properties": {
"endpointUrl": "[listCallbackUrl(variables('TargetLogicApp').triggerId, '2019-05-01').value]"
}
},
"filter": {
"includedEventTypes": [
"Microsoft.Resources.ResourceWriteFailure",
"Microsoft.Resources.ResourceWriteSuccess"
]
}
},
"dependsOn": [
"[parameters('Topics')]",
"[parameters('targetLogicApp').name]"
]
},

需要启用目标逻辑应用程序才能正确分配订阅。

在触发的逻辑应用程序中应用API连接器进行事件网格发布:

{
"type": "Microsoft.Web/connections",
"apiVersion": "2016-06-01",
"name": "[parameters('connections_azureeventgridpublish_name')]",
"location": "[parameters('location')]",
"tags": "[parameters('resourceTags')]",
"properties": {
"displayName": "conn-exrate-egt",
"customParameterValues": {},
"parameterValues": {
"endpoint": "[reference(variables('eventGridTopic').name).endpoint]",
"api_key": "[listKeys(variables('eventGridTopic').resourceId, '2020-04-01-preview').key1]"
},
"api": {
"id": "[concat('/subscriptions/x/providers/Microsoft.Web/locations/northeurope/managedApis/', parameters('connections_azureeventgridpublish_name'))]"
}
}
},

相关内容

最新更新