skip to Main Content

Hi I created an Azure data flow that transfer json from json file to cosmos db. The CosmosDbNoSql linked service connects successful. The Blob storage linked service for json file connects successful as well. The data flow is ok without any error. When refreshing data preview in debug the error always display. "Client initialization failed. Check if the endpoint is reachable and if your auth token is valid. More info: https://aka.ms/cosmosdb-tsg-service-unavailable-java"

The link displays the blow content.

Client initialization failure
The following exception is hit if the SDK isn’t able to talk to the Azure Cosmos DB instance. This exception normally indicates some security protocol like a firewall rule that is blocking the requests.

Java
java.lang.RuntimeException: Client initialization failed. Check if the endpoint is reachable and if your auth token is valid

To validate the SDK can communicate to the Azure Cosmos DB account execute the following command from where the application is hosted. If it fails this points to a firewall rule or other security feature blocking the request. If it succeeds the SDK should be able to communicate to the Azure Cosmos DB account.

Java
telnet myCosmosDbAccountName.documents.azure.com 443

It would be appreciated someone can let me know how to do the process "To validate the SDK can communicate to the Azure Cosmos DB account execute the following command from where the application is hosted." or how to the issue as I don’t find any details about it. Thanks million.

I created a new Azure integration runtime for cosmos. The connection works. The integration runtime for blob hasn’t been changed and uses the default (AutoResolveIntegrationRuntime). The same issue happen again

2

Answers


  1. Follow the instructions below to connect to Cosmos DB:

    1. Manually select the server from the subscription, as shown below:

    enter image description here

    1. Double-check the authentication token (such as the Cosmos DB account key or shared access signature) used in your Azure Data Factory linked service for Cosmos DB. Ensure that the token is valid and has sufficient permissions to access the Cosmos DB account.

    2. Make sure the network is configured correctly to access the database, as shown below:

    enter image description here

    1. These instructions should allow you to read the data from the Cosmos DB account, as shown below:

    enter image description here

    5.Use the same integration runtime for both linked services.

    A similar question was raised on the MS Q&A platform. You can check this.

    Login or Signup to reply.
  2. consider using Azure IR with VNET enabled in both blob and cosmos linked services and also when you enable debug mode for dataflows, consider selecting same Azure IR in the debug mode as well.

    above should help you.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search