Azure API 管理:处理不同环境的良好实践是什么?

huangapple go评论64阅读模式
英文:

Azure API Management: What is a good practise to handle different environments?

问题

我正在使用Azure API管理来记录和测试几个不同环境(如开发、测试和生产)中的多个网络服务和端点。目前,我通过不同的API来区分不同的环境,然后使用标签对它们进行标记,以便更好地查看API。我想知道在Azure API管理中是否有更好的解决方案来处理不同的环境?因为使用这种解决方案,我会有几个相似的请求...

(我在考虑类似Postman中的“环境”功能。)

英文:

I am using Azure API Management to document and test several webservices and endpoints in different environments like dev, test and prod. Currently, I separate different enviroments via different APIs. Then I tag them in order have a better overview of the APIs. I am wondering if there is a better solution to deal with environments in Azure API Management? Because with this solution I have several similar requests...

(I am thinking about something like "Environments" in Postman.)

答案1

得分: 3

请找到下面一些你可以尝试的选项:

选项#1:
正如你正确提到的,使用标签来标识开发、生产和暂存环境是有帮助的。在处理特定环境时,你可以利用按标签筛选或按标签分组的选项。查看这里

选项#2:
另一种选择是在一定程度上利用APIM版本控制功能,尽管它并不完全符合你的需求。这允许创建可以在开发/生产等环境之间移动的不同API版本。每个版本都可以根据其自身的设置和策略进行定制,提供独立更改每个版本的灵活性。

选项#3:
你可以尝试使用诸如Azure DevOps或其他CI/CD工具来在不同环境之间传输API管理资源。通过这种方法,API和策略可以在代码中进行管理,并且可以使用流水线将它们部署到不同的环境中。

选项#4:
此外,可以使用命名值来存储像API密钥和连接字符串这样的特定于环境的信息,从而消除了为不同的API和版本重新创建配置的需要。

根据你的需求,你可以探索这些选项并选择最合适的一个。

英文:

Please find below some of the options you could try:

Option #1:
As you rightly mentioned, using tags for Dev, Production and Staging environments can help. You can then leverage the Filter by Tags or Group by Tags options while working on a particular environment.see this

Option #2:
Other alternative is to leverage the APIM versioning feature to some extent though it is not meant for your exact requirement. This allows the creation of different API versions that can be moved between environments like Dev / Prod. Each version can be customized with its own settings and policies, offering flexibility to change each version independently.

Option #3:
You could try using tools such as Azure DevOps or other CI/CD tools to transfer API management resources between environments. With this approach, APIs and policies can be managed in code, and pipelines can be used to deploy them to different environments.

Option #4:
Additionally, named values can be employed to store environment-specific information like API keys and connection strings, thereby eliminating the need to recreate configurations for different APIs and versions.

Depending on your requirement, you may explore these options and choose the most suitable one.

huangapple
  • 本文由 发表于 2023年3月9日 22:18:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/75685831.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定