Azure Logic应用程序:将HTTP请求标头密钥值获取到条件检查中 [英] Azure Logic Apps : Get HTTP Request Header Key Value into Conditional Check

查看:119
本文介绍了Azure Logic应用程序:将HTTP请求标头密钥值获取到条件检查中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Azure门户中创建了一个Logic App.它由HTTP POST触发,在该POST中,我设置了一个名为"jmb_private_key"的密钥.在Logic App收到HTTP请求之后,我放置了一个条件,我想检查该键.

I've created a Logic App in the Azure Portal. It's triggered by an HTTP POST and in that POST I have set a Key called "jmb_private_key". After the Logic App receives the HTTP Request I've placed a Conditional which I want to check for the Key.

检查Header CONTAINS 'myvalue'不起作用.
我想检查Header.Keys['jmb_private_key'] EQUALS 'myvalue',但我不知道该怎么做.

Checking for Header CONTAINS 'myvalue' does not work.
I want to check Header.Keys['jmb_private_key'] EQUALS 'myvalue' but I don't know how that is done.

当我检查Logic App的运行时,我看到传递了正确的JSON有效负载,但是即使JSON中包含正确的值,也没有满足条件.

When I check the run of the Logic App, I see the correct JSON payload was delivered, but condition was not met, even though the correct value is in the JSON.

推荐答案

感谢@Thomas提供了以上评论中的答案.

Thanks to @Thomas for the answer in comments above.

将Logic App Designer切换到代码视图",然后将条件代码替换为以下内容:

Switch the Logic App Designer to Code View and then replace the Conditional code with something like this:

            "expression": {
                "and": [
                    {
                        "equals": [
                            "@triggerOutputs()?['headers']?['jmb_private_key']",
                            "yourkeyvalue"
                        ]
                    }
                ]
            },

这篇关于Azure Logic应用程序:将HTTP请求标头密钥值获取到条件检查中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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