我想尝试以下 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
就是这个。
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
结果中的名称
就是您想要的。
关于azure - 如何显示 Azure 的用户 ID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55371378/