Azure Cosmos DB 快速入门示例不起作用

Ton*_*ony 3 c# gremlin azure-cosmosdb

我创建了一个新的 Azure CosmosDB (Gremlin API),然后下载了快速入门示例:

CosmosDB Gremlin API 快速入门

当我运行它时,出现此异常:

JsonReaderException:从 JsonReader 读取 JObject 时出错。路径 '',第 0 行,位置 0。

我检查了一下,端点和 authKey 已设置。

    public async Task RunAsync(DocumentClient client)
    {
        // the line below throws the Exception
        Database database = await client.CreateDatabaseIfNotExistsAsync(new Database { Id = "graphdb" });

        DocumentCollection graph = await client.CreateDocumentCollectionIfNotExistsAsync(
            UriFactory.CreateDatabaseUri("graphdb"),
            new DocumentCollection { Id = "Persons" },
            new RequestOptions { OfferThroughput = 1000 });
Run Code Online (Sandbox Code Playgroud)

截屏

Quickstard 示例附带在 App.config 文件中填写的端点和 authKey: 应用程序配置

怎么解决呢?

Mat*_*nta 5

请将端点更改为此格式https://<account-name>.documents.azure.com:443/

这是新创建的 Gremlin 帐户当前存在的问题,很快就会在快速入门中得到解决。