Azure functions - Getting java.lang.IllegalStateException: Timeout on blocking read for 120000 MILLISECONDS on connecting with cosmos client

Viewed 632

Trying to connect to cosmos database using:

CosmosClient client =
      new CosmosClientBuilder()
          .endpoint("endpoint")
          .key("key")
          .consistencyLevel(ConsistencyLevel.EVENTUAL)
          .buildClient();

While connecting getting error of : java.lang.IllegalStateException: Timeout on blocking read for 120000 MILLISECONDS

1 Answers

Add preferredRegions to the settings of CosmosClientBuilder.

Related