Azure / azure-cosmosdb-java

Java Async SDK for SQL API of Azure Cosmos DB
MIT License
54 stars 61 forks source link

CosmosDb Java client and private endpoints #346

Open jagadish-v0 opened 4 years ago

jagadish-v0 commented 4 years ago

Created a private endpoint for my CosmosDb storage account and try to connect to it. Getting a ConnectTimeOutException..

io.netty.channel.ConnectTimeoutException: connection timed out: cosmos-account-41895-eastus.documents.azure.com/10.3.168.11:21226

If I try to connect to the storage account using the azure cli from the same machine, it works fine.

az cosmosdb sql database create --account-name cosmos-account-41895 --name testdb --resource-group rg-name

For context, I'm using the java library: com.azure:azure-cosmos:4.0.1-beta.1. Does the Java client support private endpoints yet?

kushagraThapar commented 4 years ago

@jagadish-v0 - V4 Cosmos SDK repo is different : https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/cosmos/azure-cosmos

Can you please create this issue there ? This repo is for V2 Cosmos Java Async SDK.

I think you have to enable TCP endpoints in your Cosmos DB Account to be able to connect to the account. Please take a look at these performance tips for java SDK v4

kushagraThapar commented 4 years ago

https://docs.microsoft.com/en-us/azure/cosmos-db/performance-tips-java-sdk-v4-sql?tabs=api-async

jagadish-v0 commented 4 years ago

I think you have to enable TCP endpoints in your Cosmos DB Account to be able to connect to the account. Please take a look at these performance tips for java SDK v4

thanks for the pointer @kushagraThapar. I reviewed the link you provided and didn't find anything related to "enabling TCP endpoints on the CosmosDb account."

Can you share some more detail on this? eg: should this be done through the portal / CLI / CosmosDb client api?