简体   繁体   English

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

[英]Azure Cosmos DB Quickstart example not working

I created a new Azure CosmosDB (Gremlin API), then downloaded the Quickstart example: 我创建了一个新的Azure CosmosDB(Gremlin API),然后下载了快速入门示例:

CosmosDB Gremlin API快速入门

when I run it, this Exception appears: 当我运行它时,出现此异常:

JsonReaderException: Error reading JObject from JsonReader. JsonReaderException:从JsonReader读取JObject时出错。 Path '', line 0, position 0. 路径'',第0行,位置0。

I checked, the endpoint and authKey are set. 我检查了端点和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 });

截图

The Quickstard sample comes with endpoint and authKey filled in on the App.config file: Quickstard示例带有在App.config文件中填充的终结点和authKey: App.config中

How to solve it? 怎么解决呢?

Please change the Endpoint to this format https://<account-name>.documents.azure.com:443/ . 请将端点更改为以下格式https://<account-name>.documents.azure.com:443/

This is a current issue with the newly created Gremlin accounts and will be addressed shortly in the Quickstarts. 这是新创建的Gremlin帐户的当前问题,很快就会在快速入门中得到解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM