通过 Azure ARM Rest 创建机器人连接 API
Creating a bot connection via Azure ARM Rest API
所以,我一直在尝试使用 Azure Rest API 来创建一些资源。更具体地说,我正在尝试使用 Insomnia 创建机器人连接。请求和响应是这样的:
我正在使用 PUT 方法(如您所见),URL(已编辑敏感数据)如下:
https://management.azure.com/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.BotService/botServices/bot-poc-myweb/Connections/mywebbot?api-version=2018-07-12
错误提示找不到连接资源。嗯.. 没什么好惊讶的,因为我有点想创造它。有人知道哪里出了问题吗?
试试这个:
请求URL:
PUT https://management.azure.com/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.BotService/botServices/<bot_name>/Connections/<conn_name>?api-version=2018-07-12
请求正文:
{
"location": "global",
"properties": {
"scopes": "<scopes>",
"serviceProviderId": "30dd229c-58e3-4a48-bdfd-91ec48eb906c",
"clientId": "<client id>",
"clientSecret": "<secret>",
"parameters": [
{
"key": "clientId",
"value": "<client id>"
},
{
"key": "clientSecret",
"value": "<secret>"
},
{
"key": "tokenExchangeUrl",
"value": "<token exchange URL>"
},
{
"key": "tenantId",
"value": "<tenant id>"
}
]
}
}
结果:
所以,我一直在尝试使用 Azure Rest API 来创建一些资源。更具体地说,我正在尝试使用 Insomnia 创建机器人连接。请求和响应是这样的:
我正在使用 PUT 方法(如您所见),URL(已编辑敏感数据)如下:
https://management.azure.com/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.BotService/botServices/bot-poc-myweb/Connections/mywebbot?api-version=2018-07-12
错误提示找不到连接资源。嗯.. 没什么好惊讶的,因为我有点想创造它。有人知道哪里出了问题吗?
试试这个:
请求URL:
PUT https://management.azure.com/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.BotService/botServices/<bot_name>/Connections/<conn_name>?api-version=2018-07-12
请求正文:
{
"location": "global",
"properties": {
"scopes": "<scopes>",
"serviceProviderId": "30dd229c-58e3-4a48-bdfd-91ec48eb906c",
"clientId": "<client id>",
"clientSecret": "<secret>",
"parameters": [
{
"key": "clientId",
"value": "<client id>"
},
{
"key": "clientSecret",
"value": "<secret>"
},
{
"key": "tokenExchangeUrl",
"value": "<token exchange URL>"
},
{
"key": "tenantId",
"value": "<tenant id>"
}
]
}
}
结果: