ARM模板部署-逻辑应用程序到事件网格主题和多个订阅,可调用更多逻辑应用程序 [英] ARM Template deployment - Logic App to Event Grid Topic and multi Subscriptions calling more Logic Apps

查看:51
本文介绍了ARM模板部署-逻辑应用程序到事件网格主题和多个订阅,可调用更多逻辑应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力将事件网格订阅,事件网格主题和逻辑应用程序添加到单个ARM模板中.首先,在订阅"中,我无法引用该URL,而该URL也正在部署中:

I am struggling adding the Event Grid Subscriptions, event grid topics and logic apps into a single ARM template. Firstly within the Subscription I cannot reference the url a Logic App that is also being deployed:

 "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:api版本2019-06-01不支持IpFiltering.

所以我的主要问题是,如何使它正常工作?

So my main question is, how can I get this to work?

此外,我对在主部署模板中仅运行上述内容感到满意,但是否可以在主Logic App中链接发布EventGrid"操作以连接到事件网格"主题(它也需要SAS令牌)作为主题网址)?

Additionally I am content with running just the above inside my main deployment template, but is it at all possible to link the Publish EventGrid action inside the main Logic App to connect to the Event Grid Topic (it requires a SAS Token as well as the topics url)?

推荐答案

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

Resolved both problems I had.

设置变量:

"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资源中:

And then inside the EventGridTopic resource:

{
        "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]"
        ]
    },

需要启用目标Logic Apps,才能正确分配订阅.

The target Logic Apps need to be enabled for the subscription to be correctly assigned.

要在触发的Logic App中将API连接器应用于事件网格发布,请执行以下操作:

To apply the API Connector for Event Grid Publish within triggered Logic App:

{
        "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'))]"
            }
        }
    },

这篇关于ARM模板部署-逻辑应用程序到事件网格主题和多个订阅,可调用更多逻辑应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆