Share via

Batch Execution in APIM

Suresh Thakur, Kirti 86 Reputation points
2021-11-18T06:44:50.713+00:00

I have created a API which is masking the url of backend service.
The BE API is REST API and is expecting a batch execution.

Ex - The request coming from FE - https://abc.pqr.com:443/$batch - POST operation
This request would have payload like

  1. GET EntityA Http /1.1
  2. GET EntityA Http /1.1
  3. POST EntityA Http /1.1

APIM url - https://azure-api.com:443/resource - masked url and will send the payload.

But I want to add a check that if the payload has all GET method then only allow request to be sent to BE or else if it has any other method like PUT, POST then error out the request and do not send to BE.

In APIM how do i achieve this using policy.

Azure API Management
Azure API Management

An Azure service that provides a hybrid, multi-cloud management platform for APIs.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,661 Reputation points Microsoft Employee Moderator
    2021-11-22T05:59:29.783+00:00

    @Suresh Thakur, Kirti You could perform a validation by checking the contents of the request body using policy expresions and then leverage the choose policy to return a response in case the request body isn't as required or forward the request as usual.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.