6

I am developing an application using microservice-based architecture. I Know that on Azure API management we can register our APIs. Now the problem I am facing is that my micro-services(development and production ) are deployed on AKS(Azure Kubernetes Service) and both have different IP Addresses as provided by the AKS. How do I differentiate between the two environments so that my front end team has two separate URLs for development and production? The base URI of the API Gateway on azure is pre-configured and cannot be changed, how do I get two URLs?

My main concern is do I need to create two instances of Azure API Management Service?

Lucky Rajput
  • 63
  • 1
  • 5

2 Answers2

5

If you don't want to create several instances, you might also try using versions and revisions.

  1. Revisions

You can create revisions by right-clicking an API and tap "Add revision". Revisions

The revision can be accessed via the rev=2 url specifier as shown in the picture above. After successful testing, you can easily set a revision to be the "current" API, which won't need a revision specifier anymore.

  1. Versions

You can create a version by right-clicking an API and tap "Add version". API Management Versions

In the "Versioning scheme" dropdown, you can also choose how the version should be specified. The options are:

  • Path
  • Query string
  • Header

so you can target each version separately.

DSpirit
  • 2,062
  • 16
  • 22
  • 3
    Revisions are meant to track non-breaking API changes. It definitely feels like a hack to repurpose them to differentiate between development/production. Similarly, versions are meant to track breaking API changes. By repurposing both of these, it limits the ability to make future changes to the API. – bmaupin May 27 '22 at 15:36
4

Have you checked Azure API Management DevOps Resource Kit . As recommended, yes you need to create two instances for your environments and deploy using ARM templates

enter image description here

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
  • I agree this is the best answer for an enterprise setup. However, if you have a small (hobby) project, with cost savings in mind, I would use versioning. – Cloudkollektiv Aug 26 '21 at 11:06
  • Running into the same issue. You might not want to have 2 instances, as it would not be really user friendly to have 2 instances of the developer portal. I might not want to enforce consumers to signup twice, in two different developer portals (tst/prd) – Robin van den Berg Aug 04 '23 at 12:48