Logic Apps received the long waited response mocking a while ago (link to docs). This is a beginning (and hopefully not the end) where you can return one static response.
In most cases you would probably like to have a capability to dynamically choose which response you get from many, but at least I couldn’t use Logic App expressions to return a specific response based on received payload. The runtimeConfiguration.staticResult object’s properties don’t seem to like expressions…
Working with ARM template parameters
Anyway – a little bit of testing this feature allowed me to do something that may help in some automated or manual test scenarios with the use of ARM template parameters. So I created a parameter containing all possible results (pStaticResults) and one for which result to use (pStaticResultToUse).
"parameters": { "pStaticResultToUse": { "type": "string", "metadata": { "description": "Name of static result to use" }, "defaultValue": "" }, "pStaticResults": { "type": "object", "metadata": { "description": "different static results" }, "defaultValue": { "HTTP0": { "outputs": { "body": { "code": "HTTP0" }, "headers": { "MyHeader": "MyValue0" }, "statusCode": "OK" }, "status": "Succeeded" }, "HTTP1": { "outputs": { "body": { "code": "HTTP1" }, "headers": { "MyHeader": "MyValue1" }, "statusCode": "OK" }, "status": "Succeeded" } } } }







Changing response manually
What I also noticed is that you can manually edit and change the response you get – but only in the code view!
If you modify the response name there, it will save and keep your all your static results.
But if you happen to save your Logic App in designer view, it will delete the other than selected response from the definition.
Test templates can be downloaded from here.
