How can we improve Azure API Management?

Customize error schema messages

Is there a way to control message error schema in Azure APIM? .. we don't want expose two kind of message errors .. we would like to return always the same structure.

In our case, we use a diagnostics object to return message errors in our internal API:

{"$diagnosis": [{"$severity": "error","$sdataCode":"errorCode","$message": "errorMessage","$source": "urlSource"}]}

However, if we overflow the rate limit policy, Azure APIM returns an object like this:

{"statusCode": 429,"message": "Rate limit is exceeded. Try again in 52 seconds."}

We would like to return in this case something like this:

{"$diagnosis": [{"$severity": "error","$sdataCode":"429","$message": "Rate limit is exceeded. Try again in 52 seconds.","$source": "https://ssbservices1.azure-api.net/payrolls/5265928652/banks"}]}

20 votes
Vote
Sign in
(thinking…)
Sign in with: Microsoft
Signed in as (Sign out)
You have left! (?) (thinking…)
Carlos shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

0 comments

Sign in
(thinking…)
Sign in with: Microsoft
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base