title: Unable to connect to MongoDB Atlas from spring boot app deployed in azure
body: <ol>
  <li><p>I deployed a spring boot app in Azure and have the below property in application.properties.
  <strong>spring.data.mongodb.uri=mongodb+srv://<em>username</em>:<em>password</em>@cluster0-host.azure.mongodb.net/test?ssl=true</strong></p></li>
  <li><p>I did a nslookup myapp-rest-api.azurewebsites.net -> fetched the ip address and added in mongodbAtlas  IPWhitelist.</p></li>
  <li><p>When I hit a endpoint exposed by the app deployed on azure(this endpoint fetches the data from mongoDB Atlas). I get the below error:</p></li>
  </ol>
  
  <p>2020-04-17T16:13:09.562280844Z: [INFO]  org.springframework.dao.DataAccessResourceFailureException: Timed out after 30000 ms while waiting for a server that matches com.mongodb.Mongo$4@48dc8d35. Client view of cluster state is {type=REPLICA_SET, servers=[{address=cluster0-shard-00-02-40bvf.azure.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}, {address=cluster0-shard-00-01-40bvf.azure.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}, {address=cluster0-shard-00-00-40bvf.azure.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]; nested exception is com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches com.mongodb.Mongo$4@48dc8d35. Client view of cluster state is {type=REPLICA_SET, servers=[{address=cluster0-shard-00-02-40bvf.azure.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}, {address=cluster0-shard-00-01-40bvf.azure.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}, {address=cluster0-shard-00-00-40bvf.azure.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]</p>
  
  <p>Can someone help me resolve this issue ?</p>