azure - 如何通过 Postman 获取我的架构(来自 Azure 架构注册表)?
问题描述
我正在尝试从 Azure 架构注册表获取架构。是否有可能通过 REST API 与 Schema Registry 进行通信?
解决方案
如果您想从一个事件中心命名空间的架构组中获取架构,请参考以下步骤
- 创建服务主体并将 Azure RABC 角色分配给
Schema Registry Reader
sp。更多详情请参考官方文档
az ad sp create-for-rbac -n "MyApp" --role "Schema Registry Reader" --scope <the scope according to your need>
- 获取令牌
POST https://login.microsoftonline.com/<tennat id>/oauth2/v2.0/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
&client_id=
&client_secret=
&scope=https://eventhubs.azure.net/.default
- 调用接口
一种。列出架构组
https://<namespace name>.servicebus.windows.net/$schemagroups?api-version=2020-09-01-preview
Authorization: Bearer <token>
湾。列出一组中的模式
https://<namespace name>.servicebus.windows.net/$schemagroups/<group name>/schemas?api-version=2020-09-01-preview
Authorization: Bearer <token>
C。得到一个模式
https://<namespace name>.servicebus.windows.net/$schemagroups/<group name>/schemas/<>?api-version=2020-09-01-preview
Authorization: Bearer <token>
推荐阅读
- qt - QListView 可以检测到特定的 QString 并因此自动触发插槽吗?
- blazor - 从模型外键绑定值
- reactjs - 错误:无法读取未定义的属性“令牌”
- linux - 在 Ubuntu 中构建 WebLogic Docker 映像不起作用
- sql - 在sql中如何获得由两列分组的总和的最大值
- python - 如何通过 python 执行 powershell 命令并给出与在终端中运行相同的结果?
- c - 为什么 realloc() 在多次调用时会在动态数组中引入一些随机值?
- networking - 使用 Traefik Ingress Controller 将流量路由到 Kubernetes 外部
- sql - 每个卡车编号仅显示一个以上的唯一客户/地址
- sql - 为什么我的 Azure 应用服务备份无法连接到我的 Azure SQL 数据库?