gpt4 book ai didi

azure - 使用 Arm 模板在机器人 channel 注册连接上设置租户 ID

转载 作者:行者123 更新时间:2023-12-03 00:57:54 24 4
gpt4 key购买 nike

当使用 ARM 模板为机器人 channel 注册创建新连接时,我使用以下资源作为 Microsoft.BotService/botServices 的一部分;

    {
"type": "Microsoft.BotService/botServices/Connections",
"apiVersion": "2018-07-12",
"name": "[concat(parameters('botName'), '/ActiveDirectory')]",
"dependsOn": [
"[resourceId('Microsoft.BotService/botServices', parameters('botName'))]"
],
"location": "global",
"tags": "[parameters('resourceTags')]",
"properties": {
"clientId": "[parameters('appId')]",
"clientSecret": "[parameters('appSecret')]",
"scopes": "[parameters('scopes')]",
"serviceProviderId": "30dd229c-58e3-4a48-bdfd-91ec48eb906c",
"serviceProviderDisplayName": "Azure Active Directory v2",
"parameters": []
}
}

这让我获得了除 token 交换 Url 和租户 ID 之外的所有字段,我确实需要填写这些字段; enter image description here

我检查了documentation并且找不到任何关于此的信息。我尝试添加以下参数进行测试;

       "parameters": [
{
"key": "tenantID",
"value": "customValue"
}
]

这没有做任何事情,也只是猜测这里的 key 应该是什么..

如何使用 Arm 模板设置这两个字段?

最佳答案

参数就是正确的选择。但是,在使用参数时,clientID 和 clientSecret 也需要是一个参数,因为当存在参数时,它们不再被拾取为属性。在资源 Json 下面,它对我来说是有效的;

    {
"type": "Microsoft.BotService/botServices/Connections",
"apiVersion": "2018-07-12",
"name": "[concat(parameters('botName'), '/ActiveDirectory')]",
"condition": "[equals(parameters('oauthEnabled'), 'True')]",
"dependsOn": [
"[resourceId('Microsoft.BotService/botServices', parameters('botName'))]"
],
"location": "global",
"tags": "[parameters('resourceTags')]",
"properties": {
"serviceProviderId": "30dd229c-58e3-4a48-bdfd-91ec48eb906c",
"serviceProviderDisplayName": "Azure Active Directory v2",
"parameters": [
{
"key": "clientId",
"value": "[parameters('appId')]"
},
{
"key": "clientSecret",
"value": "[parameters('appSecret')]"
},
{
"key": "scopes",
"value": "[parameters('scopes')]"
},
{
"key": "tenantID",
"value": "common"
},
{
"key": "tokenExchangeUrl",
"value": "[concat('api://botid-', parameters('appId'))]"
}
]
}
}

关于azure - 使用 Arm 模板在机器人 channel 注册连接上设置租户 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64932997/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com