Yudai Ishida
Yudai Ishida

Reputation: 47

How to set RestFul Service using Azure API Management Service?

I'm trying to create API Management operation using RestAPI like a "/{x}/{y}/{z}.png" I don't want to rewrite-url "x={x}&y={y}&z={z}.png".

How to set api config?

Please give me some advice and document's URL(ノДヽ) ・・

  1. Add API
  2. Set name ,API name,Service URL and API URL suffix
  3. Set Operations ( method,URL template ,RESPONSES)

・original service url http://hogehoge/xyz/std/6/58/25.png

・using azure api management http://xxxxxxxxx.azure-api.net/xyz/std/6/58/25.png

Upvotes: 0

Views: 84

Answers (1)

Vitaliy Kurokhtin
Vitaliy Kurokhtin

Reputation: 7840

  • Create an API:
  • Create an operation:
    • Verb: GET
    • URL template: {x}/{y}/{z}.png
    • No rewrite URL

That should do it:

  • When call is made to http://xxxxxxxxx.azure-api.net/xyz/std/6/58/25.png APIM will "bite off" scheme and host and be left with "xyz/std/6/58/25.png".
  • It will check if path contains any of APIs suffixes, it does contain "xyz/std" so API will be matched and suffix will be "bitten off" again. What is left is "6/58/25.png".
  • It will check if remainder of the path matches any operation template within identified API, it does match {x}/{y}/{z}.png, so operation is identified.
  • It will take Web service URL from API settings and attach part of path that matched operation template to it getting http://hogehoge/xyz/std/6/58/25.png, so this will be the URL it will make a call to serve the request.

Upvotes: 1

Related Questions