我尝试通过REST API在Azure Bot注册中将站点添加到我的DirectLine频道。当我针对以下ARM REST URL执行GET时,我获得了列出任何现有站点的JSON有效负载。
https://management.azure.com/subscriptions/ {azure.SubscriptionId} / resourceGroups / {MyResourceGroupName} /providers/Microsoft.BotService/botServices/ {MyBotHandle} /信道/ DirectLineChannel?API-版本= 2017年12月1日
如果我然后从GET调用中获取JSON输出并像这样添加一个Site ...
{
"id": "/subscriptions/{SubscriptionID}/resourceGroups/{ResourceGroupName}/providers/Microsoft.BotService/botServices/{BotHandle}/channels/DirectLineChannel",
"name": "{BotHandle}/DirectLineChannel",
"type": "Microsoft.BotService/botServices/channels",
"etag": "W/\"8e7678d65f7dbeea8863f0c68af75f606/6/2018 6:31:37 PM\"",
"location": "global",
"properties": {
"properties": {
"DirectLineEmbedCode": null,
"sites": [
{
"siteId": "uXuynMwVIBI",
"siteName": "Default Site",
"key": "uXuynMwVIBI.cwA.ve8.m2IbJ0McgjmxAq8vlZ1ZY1jAFdpdQj14GbgrS4z-qpA",
"key2": "uXuynMwVIBI.cwA.gXE.4aZw5_DIJuLPsQ2zjIYSCMztTxUxNpX4trwfO-6Gb9k",
"isEnabled": true,
"isV1Enabled": true,
"isV3Enabled": true
}
]
},
"etag": "W/\"8e7678d65f7dbeea8863f0c68af75f606/6/2018 6:31:37 PM\"",
"channelName": "DirectLineChannel",
"location": "global",
"provisioningState": "Succeeded"
}
}
...然后对同一个初始URL执行PUT,我收到以下错误:
发生意外错误。例外:' Microsoft.Bot.Schema.APIException:清空服务错误响应。 ID:\ r \ n在Intercom.Channels.Models.Shared.TimeLimitedConfigHttpClient
1.<GetFromResponseAsync>d__20.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at Intercom.Channels.Models.Shared.TimeLimitedConfigHttpClient
1.d__10.MoveNext()\ r \ n ---从先前位置抛出异常的堆栈跟踪结束--- r \ n在System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\ r \ n在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)\ r \ n在Intercom.Channels.Models.Shared.ConfigApi {{1 1.ConfiguredTaskAwaiter.GetResult()\ r \ n在Intercom.ResourceProvider.Channels.ArmChannelManager.d__21.<PutAsync>d__7.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.ConfiguredTaskAwaitable
1.ConfiguredTaskAwaiter.GetResult()\ r \ n在Intercom.ResourceProvider.DataProviders.ChannelResourceDataProvider.d__5。的MoveNext()&#39;
我注意到这个JSON看起来像一个ARM模板,所以我尝试将它添加到部署中,我得到了完全相同的错误。它配置机器人,然后在配置DirectLineChannel时我得到一个InternalServerError。操作详细信息链接给出了上述错误。
有关如何做到这一点的任何想法?我离开了吗?
谢谢!