【问题标题】:Authenticate against Azure Computer Vision OCR using user managed identity使用用户管理的标识针对 Azure 计算机视觉 OCR 进行身份验证
【发布时间】:2021-08-18 03:27:28
【问题描述】:

我想在我的 AKS pod 中使用用户管理的身份来通过 Azure Computer Vision OCR API 进行身份验证。

托管标识已创建,我可以在 azure 门户中看到托管标识

{
    "id": "/subscriptions/.../userAssignedIdentities/my-msi",
    "name": "my-msi",
    "type": "Microsoft.ManagedIdentity/userAssignedIdentities",
    "location": "westeurope",
    "tags": {},
    "properties": {
        "tenantId": "<tenant id>",
        "principalId": "<principle id>",
        "clientId": "<client id>"
    }
}

并且托管标识对具有端点的认知服务资源具有“认知服务参与者”角色
https://&lt;my-custom-sub-domain&gt;.cognitiveservices.azure.com/

现在,在我在 AKS pod 中运行的 python 应用程序中(已经有正确的aadpodbinding 标签)我想发送一个 POST 请求到 https://&lt;my-custom-sub-domain&gt;.cognitiveservices.azure.com/vision/v3.2/read/analyze 带有要应用 OCR 的 PDF 图像。

不幸的是,Cognitive Services documentation 上没有太多关于如何做到这一点的描述

我正在寻找类似于this one for authentication against key vault using managed identity的python示例

【问题讨论】:

    标签: azure azure-managed-identity


    【解决方案1】:

    在 AKS 中添加 pod 身份允许您使用本地令牌端点获取令牌。

    您只需获取“https://cognitiveservices.azure.com/”的令牌并将其添加到对认知服务的 Web 请求的授权标头中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-30
      • 2019-09-27
      • 1970-01-01
      • 1970-01-01
      • 2019-09-08
      • 2020-06-08
      相关资源
      最近更新 更多