【发布时间】:2020-01-25 10:44:26
【问题描述】:
我正在尝试将实验性天气技能添加到虚拟助手,并通过 Azure Web 测试对其进行测试。 虚拟助手和天气技能都按预期工作,但如果我使用 botskills 连接将技能附加到助手,重新发布并在 Azure 中测试它,然后在虚拟助手中询问天气,它会显示“正在发送...发送失败”
我在查看“频道”页面时看到网关超时错误。
“向您的机器人发送此消息时出错:HTTP 状态代码 GatewayTimeout”
使用以下命令将技能附加到虚拟助手时
botskills connect --botName MyBotName-xxxxx --remoteManifest "https://weatherskill-xxxxx.azurewebsites.net/api/skill/manifest" --luisFolder "(技能解决方案文件夹的路径)\Deployment\Resources\LU\en\" --cs --verbose
在收到此警告之前一切正常
“无法自动配置身份验证连接。 您的技能清单中没有 Azure Active Directory v2 身份验证连接。”
问题可能与此有关吗? 我该如何解决?
这里我贴出cmets中要求的代码。
编辑:我想提一下,虚拟助手和技能也在两个不同的 Azure 资源组中
来自虚拟助手项目:
技能.json:
{
"skills": [
{
"id": "WeatherSkill",
"msaAppId": "obfuscated",
"name": "WeatherSkill",
"endpoint": "https://magicbotreplyweatherskill-xxxxxxx.azurewebsites.net/api/skill/messages",
"description": "The weather skill provides an example of displaying the current weather using AccuWeather.",
"authenticationConnections": [],
"actions": [
{
"id": "WeatherSkill_getForecast",
"definition": {
"description": "Showing the weather forecast.",
"slots": [
{
"name": "location",
"types": [
"string"
]
}
],
"triggers": {
"utteranceSources": [
{
"locale": "en",
"source": [
"WeatherSkill#GetForecast"
]
}
]
}
}
}
]
}
]
}
appsettings.json:
{
"oauthConnections": [],
"microsoftAppId": "obfuscated",
"microsoftAppPassword": "obfuscated",
"contentModerator": {
"key": "obfuscated"
},
"qnaMaker": {
"endpoint": "https://magicbotreplyresourcegroup-qnahost-xxxxxxx.azurewebsites.net",
"key": "obfuscated"
},
"blobStorage": {
"connectionString": "DefaultEndpointsProtocol=https;AccountName=magicbotreplyresourcegro;AccountKey=obfuscated;EndpointSuffix=core.windows.net",
"container": "transcripts"
},
"applicationInsights": {
"InstrumentationKey": "obfuscated"
},
"botWebAppName": "MagicBotReplyResourceGroup-xxxxxxx",
"luis": {
"accountName": "MagicBotReplyResourceGroup-luis-xxxxxxx",
"key": "obfuscated",
"region": "westeurope"
},
"cosmosDb": {
"authKey": "obfuscated",
"collectionId": "botstate-collection",
"cosmosDBEndpoint": "https://magicbotreplyresourcegroup-xxxx.documents.azure.com:443/",
"databaseId": "botstate-db"
},
"WeatherApiKey": "obfuscated"
}
launchsettings.json:
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:xxxx/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"VirtualAssistantTest1": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:xxxx/"
}
}
}
botname_en_dispatch.dispatch:
{
"authoringRegion": "westeurope",
"culture": "en-us",
"hierarchical": true,
"useAllTrainingData": false,
"dontReviseUtterance": false,
"copyLuisData": true,
"normalizeDiacritics": true,
"services": [
{
"intentName": "l_General",
"appId": "obfuscated",
"authoringKey": "obfuscated",
"version": "0.1",
"region": "westeurope",
"type": "luis",
"name": "MaGiCBoTen_General",
"id": "1"
},
{
"intentName": "q_Chitchat",
"kbId": "obfuscated",
"subscriptionKey": "obfuscated",
"type": "qna",
"name": "Chitchat",
"id": "2"
},
{
"intentName": "q_Faq",
"kbId": "obfuscated",
"subscriptionKey": "obfuscated",
"type": "qna",
"name": "Faq",
"id": "3"
}
],
"serviceIds": [
"1",
"2",
"3"
],
"appId": "obfuscated",
"authoringKey": "obfuscated",
"version": "Dispatch",
"region": "westeurope",
"type": "dispatch",
"name": "MaGiCBoTen_Dispatch"
}
认知模型.json:
{
"defaultLocale": "en-us",
"cognitiveModels": {
"en": {
"dispatchModel": {
"appid": "obfuscated",
"name": "MagicBotReplyResourceGroupen_Dispatch",
"authoringkey": "obfuscated",
"subscriptionkey": "obfuscated",
"authoringRegion": "westeurope",
"type": "dispatch",
"region": "westeurope"
},
"languageModels": [
{
"region": "westeurope",
"authoringRegion": "westeurope",
"subscriptionkey": "obfuscated",
"name": "MagicBotReplyResourceGroupen_General",
"appid": "obfuscated",
"authoringkey": "obfuscated",
"version": "0.1",
"id": "General"
}
],
"knowledgebases": [
{
"hostname": "https://magicbotreplyresourcegroup-qnahost-xxxxxxx.azurewebsites.net",
"name": "Chitchat",
"kbId": "obfuscated",
"subscriptionKey": "obfuscated",
"id": "Chitchat",
"endpointKey": "obfuscated"
},
{
"hostname": "https://magicbotreplyresourcegroup-qnahost-xxxxxxx.azurewebsites.net",
"name": "Faq",
"kbId": "obfuscated",
"subscriptionKey": "obfuscated",
"id": "Faq",
"endpointKey": "obfuscated"
}
]
}
}
}
对于技能项目:
appsettings.json:
{
"oauthConnections": [
{
"name": "",
"provider": ""
}
],
"WeatherApiKey": "obfuscated",
"microsoftAppId": "obfuscated",
"microsoftAppPassword": "obfuscated",
"blobStorage": {
"connectionString": "DefaultEndpointsProtocol=https;AccountName=magicbotreplyweatherskil;AccountKey=obfuscated;EndpointSuffix=core.windows.net",
"container": "transcripts"
},
"applicationInsights": {
"InstrumentationKey": "obfuscated"
},
"luis": {
"accountName": "magicbotreplyweatherskill-luis-yyyyyyy",
"key": "obfuscated",
"region": "westeurope"
},
"botWebAppName": "magicbotreplyweatherskill-yyyyyyy",
"cosmosDb": {
"authKey": "obfuscated",
"collectionId": "botstate-collection",
"cosmosDBEndpoint": "https://magicbotreplyweatherskill-xxxxx.documents.azure.com:443/",
"databaseId": "botstate-db"
}
}
launchsettings.json:
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:xxxx/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"WeatherSkill": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:xxxx/"
}
}
}
认知模型.json:
{
"defaultLocale": "en-us",
"cognitiveModels": {
"en": {
"languageModels": [
{
"id": "General",
"authoringKey": "obfuscated",
"version": "0.1",
"appId": "obfuscated",
"authoringRegion": "westeurope",
"subscriptionKey": "obfuscated",
"name": "magicbotreplyweatherskillen_General",
"region": "westeurope"
},
{
"id": "WeatherSkill",
"authoringKey": "obfuscated",
"version": "0.1",
"appId": "obfuscated",
"authoringRegion": "westeurope",
"subscriptionKey": "obfuscated",
"name": "magicbotreplyweatherskillen_WeatherSkill",
"region": "westeurope"
}
]
}
}
}
【问题讨论】:
-
您可以编辑您的帖子并包含两组代码(混淆任何密钥/秘密)吗?对于主要的 VA 机器人:skills.json、appsettings.json、launchSettings.json、
en_Dispatch.dispatch 和cognitivemodels.json。对于技能机器人:appsettings.json、launchSettings.json 和cognitivemodels.json。这些是配置两个机器人如何连接 LUIS、QnA 和 Dispatch 的文件。 -
我编辑了添加请求文件的帖子,但我不明白这里涉及到什么网关,以在助手与其连接的技能之间给出超时错误。
-
您能否调整您的混淆值以显示前 4 个和后 4 个字符,以便我检查它们是否正确放置?
-
我最终更新了解决方案的所有 NUGET 包,并从头开始配置/重新部署,现在它可以工作了。
标签: c# azure botframework