Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Logic Apps : Get HTTP Request Header Key Value into Conditional Check

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

like image 229
jmbmage Avatar asked May 08 '18 17:05

jmbmage


1 Answers

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"
                        ]
                    }
                ]
            },
like image 161
jmbmage Avatar answered Nov 07 '22 11:11

jmbmage