Hi Georgios Voulgarakis •,
Welcome to Microsoft Q&A forum and thanks for using Azure services.
As I understand, you are facing connectivity issues in cosmos db emulator linux container.
- Ensure the emulator is running with the following command:
docker ps --all
- Verify that the specific emulator container is in a running state.
- Verify that no other applications are using emulator ports: 8081 and 10250-10255.
- Verify that the container port 8081, is mapped correctly and accessible from an environment outside of the container.
netstat -lt
- Try to access the endpoint and port for the emulator using the Docker container's IP address instead of "localhost".
- Make sure that the emulator self-signed certificate has been properly added to KeyChain.
- For Java applications, make sure you imported the certificate to the Java Certificates Store section.
- For .NET applications you can disable TLS/SSL validation:
CosmosClientOptions cosmosClientOptions = new CosmosClientOptions()
{
HttpClientFactory = () =>
{
HttpMessageHandler httpMessageHandler = new HttpClientHandler()
{
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
};
return new HttpClient(httpMessageHandler);
},
ConnectionMode = ConnectionMode.Gateway
};
CosmosClient client = new CosmosClient(endpoint, authKey, cosmosClientOptions);
Also make sure current Docker Host processor type is compatible with our Docker image.
Refer to the documentation here for complete troubleshooting steps.
Please let us know if these steps helped. If not, please let us know so that we can further investigate. Thank you.