【发布时间】:2020-06-04 05:39:01
【问题描述】:
当我尝试从 Bot Framework 4.6 连接到 Cosmos DB 时,我不确定我的连接字符串的格式是否正确:
IStorage memoryStorage = null;
// memoryStorage = new MemoryStorage();
memoryStorage = new CosmosDbPartitionedStorage(
new CosmosDbPartitionedStorageOptions
{
CosmosDbEndpoint = "https://myDB.mongo.cosmos.azure.com:443/",
AuthKey = "MyKey",
DatabaseId = "dev",
ContainerId = "conversation-state"
}
);
var conversationState = new Models.ConversationState(memoryStorage);
var UserState = new UserState(memoryStorage);
services.AddSingleton(conversationState);
services.AddSingleton(UserState);
使用此处的文档,Cosmos 服务 URL 似乎是正确的:https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-v4-storage?view=azure-bot-service-4.0&tabs=csharp#memory-storage
上面说要使用SSL,所以我用的是443端口,但是连接字符串上的端口是10255
我错过了什么?
这是我收到的错误消息:
机器人遇到错误或错误:响应状态代码没有 表示成功:404 子状态:0 原因:(,请求URI:/, RequestStats: , SDK: Windows/10.0.17763 cosmos-netstandard-sdk/3.2.1)。
【问题讨论】:
标签: botframework azure-cosmosdb azure-cosmosdb-mongoapi