How to separate Development and Production environment on Azure API management?
Asked Answered
R

2

7

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?

Rib answered 19/12, 2019 at 9:44 Comment(0)
L
6

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.

Led answered 25/1, 2020 at 11:43 Comment(1)
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.National
P
5

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

Pollster answered 19/12, 2019 at 10:31 Comment(3)
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.Faker
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)Pecksniffian
Looks like DevOps Resource Kit now recommends APIOps from their GIT pageCleat

© 2022 - 2024 — McMap. All rights reserved.