azure - 向事件网格 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": []
}
],
解决方案
托管标识没有客户端密码。它只有证书,您无法访问。
模板必须在逻辑应用程序中执行才能获取访问令牌,我怀疑它可以做到。
推荐阅读
- javascript - 通过 ajax 传递序列化表单和二维数组
- java - 我坚持使用 MVC 模式
- python - 无法将模型中的模块导入到同一文件夹中的 admin.py
- dynamic - 设备中的动态分配使内存复制失败
- tensorflow - 注意力机制/Tensorflow 教程
- javascript - javascript - 使用“另一个选择”选择下拉菜单
- amazon-web-services - 无法使用 aws cli 的 s3 模块从请求者复制存储桶到我自己的存储桶,而我可以很好地复制到我的机器
- javascript - 没有得到预期的结果 Node Fetch POST
- node.js - Adonis 查询生成器:条件计数
- http - 调用堆栈上的错误处理 - http 请求处理程序