Azure Logic Apps : Get HTTP Request Header Key Val

2019-06-01 04:15发布

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.

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.

enter image description here

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.

enter image description here

1条回答
闹够了就滚
2楼-- · 2019-06-01 04:38

Thanks to @Thomas for the answer in comments above.

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"
                        ]
                    }
                ]
            },
查看更多
登录 后发表回答