azure - 如何显示 Azure 的用户 ID?

标签 azure azure-api-management

我想尝试以下 API。

用户 - 获取共享访问 token (API 管理) https://learn.microsoft.com/en-us/rest/api/apimanagement/user/getsharedaccesstoken

但我无法发现我的用户 ID。它可能是 24 个字符的字符串。 我怎样才能证明这一点?

最佳答案

您可以通过powershell或rest api获取userId

1.使用powershell : Get-AzApiManagementUser

$ApiMgmtContext = New-AzApiManagementContext -ResourceGroupName "<ResourceGroupName >" -ServiceName "<API Management service name>"
Get-AzApiManagementUser -Context $ApiMgmtContext

该命令会列出所有用户,找到你想要的用户,结果中的UserId就是这个。

enter image description here

2.使用rest api : User - List By Service

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users?api-version=2018-06-01-preview

结果中的名称就是您想要的。

enter image description here

关于azure - 如何显示 Azure 的用户 ID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55371378/

相关文章:

azure - Azure 应用服务的 Terraform 模板,LinuxFxVersion 具有无效值

azure-logic-apps - 从 Azure 逻辑应用调用 Api 管理时出现 "Could not establish trust relationship for the SSL/TLS secure channel"

azure-api-management - 如何使用 Azure API Manager 缓存存储值策略存储 JSON 有效负载?

arrays - 如何在 Liquid 的 for 循环中创建数组?

azure - 在内部模式下部署多个 API 管理阶段/生命周期时,是否需要单独的子网?

c# - 调用 Azure Service Fabric 中服务的特定实例

azure - 如何为服务主体设置 secret 过期警报?

Azure AD : Authentication missing or malformed

c# - 如何以编程方式在azure网站中创建虚拟应用程序和目录

Azure 云服务 - 访问被拒绝(端口绑定(bind))