The connection string is missing a required property: AccountEndpoint error while using the new CosmosClient(CosmosConnectionString)

╄→尐↘猪︶ㄣ 提交于 2020-08-10 19:20:24

问题


I am getting The connection string is missing a required property: AccountEndpoint error while using the new CosmosClient(CosmosConnectionString) constructor for CosmosClient with assembly Microsoft.Azure.Cosmos.Client, Version=3.11.0.0 - How to fix it? The connection string from the account looks like (AccountEndpoint is missing:

DefaultEndpointsProtocol=https;AccountName=devdb;AccountKey=xxxx;TableEndpoint=https://devdb.table.cosmos.azure.com:443/;

回答1:


The connection string you're specifying is for connecting to an Azure Storage account (when you use Azure.Storage.* Nuget package) or a Cosmos DB account targeting Table API (when you use (Microsoft.Azure.Cosmos.Table package).

To connect to a Cosmos DB account using Microsoft.Azure.Cosmos package, connection string must be specified in AccountEndpoint=https://account-name.documents.azure.com:443/;AccountKey=account-key; format.



来源:https://stackoverflow.com/questions/62872969/the-connection-string-is-missing-a-required-property-accountendpoint-error-whil

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!