Hi @Srivastava, Vivek K , welcome to Microsoft Q&A forum.
From the problem description, it seems while you are connecting your spring boot java application to Azure Cosmos DB Mango API you are facing the issue mentioned.
I was checking on similar issue and found that this problem might not be directly due to VPN connectivity. Could you please try one of these mentioned below and let us know if this works?
@SpringBootApplication
@EnableAutoConfiguration(exclude={MongoAutoConfiguration.class})
Or
@SpringBootApplication(exclude = {
MongoAutoConfiguration.class,
MongoDataAutoConfiguration.class
})
Reference Articles:
Exception in monitor thread while connecting to server localhost:27017 while accessing MongoDB with Java
How to disable spring-data-mongodb autoconfiguration in spring-boot
Please let us know if this helps or else we can discuss further on the same.