首页 > 解决方案 > 向事件网格 API 连接验证系统分配的身份

问题描述

谁能帮我在 ARM 模板中找到系统分配身份的客户端密码,或者建议一种替代方法?

我有一个 ARM 模板,它创建了一个具有系统分配标识的逻辑应用程序,现在我想设置一个 API 连接以从事件网格触发(不使用门户 UI 或单独的 powershell 命令)。

我不知道如何获取系统分配身份的客户端密码。这将使我能够遵循这些先前问题中的答案:

这是我到目前为止所拥有的:

"resources": [
        {
            "apiVersion": "2016-06-01",
            "type": "Microsoft.logic/workflows",
            "name": "[variables('logicName')]",
            "location": "[resourceGroup().location]",
            "identity": {
                "type": "SystemAssigned"
            },    
            "dependsOn": [
                "[variables('connections_azuretables_name')]"
            ],
            "properties": {
                "state": "Enabled",
                "definition": {
                   <<SNIP>>
                }
            }
        },
        {
            "type": "Microsoft.Web/connections",
            "apiVersion": "2016-06-01",
            "name": "[variables('azureEventGridConnectionAPIName')]",
            "location": "[resourceGroup().location]",
            "properties": {
                "api": {
                "id": "[concat('/subscriptions/subscriptionId', '/providers/Microsoft.Web/locations/', 'eastasia', '/managedApis/', 'azureeventgrid')]"

                },
                "parameterValues": {
                "token:clientId": "[reference(variables('logicName'), '2016-06-01', 'Full').identity.principalId]",
                "token:clientSecret": "########### STUCK HERE #################",
                "token:TenantId": "[reference(variables('logicName'), '2016-06-01', 'Full').identity.tenantId]",
                "token:grantType": "client_credentials"
                },
                "displayName": "[variables('azureEventGridConnectionAPIName')]"

            },
            "dependsOn": []
            }
    ],

标签: azurearm-template

解决方案


托管标识没有客户端密码。它只有证书,您无法访问。

模板必须在逻辑应用程序中执行才能获取访问令牌,我怀疑它可以做到。


推荐阅读