0
votes

I have a logic app as API (via APIM) with a HTTP Request trigger for posts. In APIM I have created a schema definition for requests

Simplified example:

{
"properties": {
    "id": {
        "type": "string"
    },
    "email": {
        "type": "string"
    }
},
"required": [
    "id",
    "email"
],
"type": "object"
}

However, when I test, the post isn't validated. I can input numbers instead of strings or send a completely empty message.

If I set up the same schema inside the logic app trigger the validation is fine but I would prefer to keep the definition in APIM so I won't have to manage schemas for both logic app and APIM for front end.

I think this has worked before, I remember having a similar logic app API where schema validation in APIM was possible.

Is there something I'm missing?

1

1 Answers

0
votes

After importing logic app to Azure APIM, the wizard will expose for you the Logic App under a POST operation. By default, the operation name will always be “request-invoke”.

To test the Logic App exposed to Azure API Management you need to:

Under the API top options menu, select Test option, and in this case, there is only one operation which will automatically get selected;

On the Request body section, select Raw option and insert a valid and expected request to be sent to the Logic App;

And finally, press “Send”.

enter image description here

And after that, you will see an expected response from the Logic App.

enter image description here

For more details about how to expose and protect Logic App using Azure API Management, you can refer to this article.