问题
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