Connection Issue From .NET MAUI Mobile APP

Trying to connect mongodb via my maui app. Connecting via compass works but having this error when trying to connect from the app.

{System.TimeoutException: A timeout occurred after 30000ms selecting a server using CompositeServerSelector{ Selectors = WritableServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 }, OperationsCountServerSelector }. Client view of cluster state is { ClusterId : "1", Type : "Unknown", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/v7mauitest.pljqm1n.mongodb.net:27017" }", EndPoint: "Unspecified/v7mauitest.pljqm1n.mongodb.net:27017", ReasonChanged: "Heartbeat", State: "Disconnected", ServerVersion: , TopologyVersion: , Type: "Unknown", HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server.
 ---> System.Net.Sockets.SocketException (00000005, 0xFFFDFFFF): hostname nor servname provided, or not known
   at System.Net.Dns.GetHostEntryOrAddressesCore(String hostName, Boolean justAddresses, AddressFamily addressFamily, Nullable`1 startingTimestamp)
   at System.Net.Dns.GetHostAddressesCore(String hostName, AddressFamily addressFamily, Nullable`1 startingTimestamp)
   at System.Net.Dns.GetHostAddresses(String hostNameOrAddress, AddressFamily family)
   at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
   at MongoDB.Driver.Core.Connections.TcpStreamFactory.ResolveEndPoints(EndPoint initial)
   at MongoDB.Driver.Core.Connections.TcpStreamFactory.CreateStream(EndPoint endPoint, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelper(CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelper(CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Connections.BinaryConnection.Open(CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Servers.ServerMonitor.InitializeConnection(CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Servers.ServerMonitor.Heartbeat(CancellationToken cancellationToken)", LastHeartbeatTimestamp: "2024-01-05T08:44:06.9001798Z", LastUpdateTimestamp: "2024-01-05T08:44:06.9003901Z" }] }.
   at MongoDB.Driver.Core.Clusters.Cluster.ThrowTimeoutException(IServerSelector selector, ClusterDescription description)
   at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChangedHelper.HandleCompletedTask(Task completedTask)
   at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChangedAsync(IServerSelector selector, ClusterDescription description, Task descriptionChangedTask, TimeSpan timeout, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Clusters.Cluster.SelectServerAsync(IServerSelector selector, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Clusters.IClusterExtensions.SelectServerAndPinIfNeededAsync(ICluster cluster, ICoreSessionHandle session, IServerSelector selector, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Bindings.WritableServerBinding.GetWriteChannelSourceAsync(CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Operations.RetryableWriteContext.InitializeAsync(CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Operations.RetryableWriteContext.CreateAsync(IWriteBinding binding, Boolean retryRequested, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Operations.BulkMixedWriteOperation.ExecuteAsync(IWriteBinding binding, CancellationToken cancellationToken)
   at MongoDB.Driver.OperationExecutor.<ExecuteWriteOperationAsync>d__5`1[[MongoDB.Driver.Core.Operations.BulkWriteOperationResult, MongoDB.Driver.Core, Version=2.23.1.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at MongoDB.Driver.MongoCollectionImpl`1.<ExecuteWriteOperationAsync>d__103`1[[MongoDB.Bson.BsonDocument, MongoDB.Bson, Version=2.23.1.0, Culture=neutral, PublicKeyToken=null],[MongoDB.Driver.Core.Operations.BulkWriteOperationResult, MongoDB.Driver.Core, Version=2.23.1.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at MongoDB.Driver.MongoCollectionImpl`1.<BulkWriteAsync>d__33[[MongoDB.Bson.BsonDocument, MongoDB.Bson, Version=2.23.1.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at MongoDB.Driver.MongoCollectionImpl`1.<UsingImplicitSessionAsync>d__109`1[[MongoDB.Bson.BsonDocument, MongoDB.Bson, Version=2.23.1.0, Culture=neutral, PublicKeyToken=null],[MongoDB.Driver.BulkWriteResult`1[[MongoDB.Bson.BsonDocument, MongoDB.Bson, Version=2.23.1.0, Culture=neutral, PublicKeyToken=null]], MongoDB.Driver, Version=2.23.1.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at MongoDB.Driver.MongoCollectionBase`1.<InsertOneAsync>d__76[[MongoDB.Bson.BsonDocument, MongoDB.Bson, Version=2.23.1.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at V7.UIS.MauiMobile.ViewModels.OutwardWaybillViewModel.TestDb() in C:\V7.UIS.MauiMobile\V7.UIS.MauiMobile\ViewModels\OutwardWaybillViewModel.cs:line 840}

Connection string is:

{
  "MongoDB": {
    "ConnectionString": "mongodb://<username>:<password>@v7mauitest.pljqm1n.mongodb.net/?retryWrites=true&w=majority",
    "DatabaseName": "MAUITestDatabase"
  }
}