使用api管理以编程方式创建api密钥,订阅我的web应用程序api [英] Programatically create api key using api management with subscriptions for a my web app api
问题描述
我有一个Nodejs应用程序。我想向开发人员公开我的api的端点。
I hava a Nodejs app. I would like to expose an endpoint of my api to developers.
我使用cosmos db作为后端。我遇到了API管理。
I use cosmos db for the backend. I came across API management.
我想知道如何以编程方式为注册我的api并让他们访问端点的开发人员生成API密钥。
I would like to know how to programatically generate API keys for developers who signup for my api and give them access to the endpoint.
在浏览API管理文档后,我遇到了订阅,但我如何以编程方式执行此操作。
After going through API management documentation I came across Subscriptions but how do I do this programatically.
欢迎任何文档和示例。
推荐答案
您可以通过编程方式生成API密钥 使用
You can generate API Keys programmatically by using
- Microsoft
Azure SDK for Node.js - ApiManagementClient - API Management REST API ,用于创建或更新指定用户的订阅。
- Microsoft Azure SDK for Node.js - ApiManagementClient
- API Management REST API for creating or updating the subscription of specified user.
同样在非消费层中subscriptio API Management中的ns始终与单个API产品范围相关联。
Also in non-Consumption tiers subscriptions in API Management were always associated with a single API product scope.
在消费层中,
订阅范围不再局限于API产品。现在可以创建允许访问API的密钥,或API管理实例中的所有API,而无需先创建产品并将API添加到其中。
In consumption tier, the scope of subscriptions is no longer limited to an API product. It's now possible to create keys that grant access to an API, or all APIs within an API Management instance, without needing to create a product and add the APIs to it first.
这篇关于使用api管理以编程方式创建api密钥,订阅我的web应用程序api的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!