I am creating an Azure Pipeline to backup MongoDB hosted on Atlas but unable to connect

I am facing the below error while connecting from Azure Pipelines to MongoDB Atlas. I am trying to run mongo dump command. I have already whitelisted the IP Subnets mentioned by Microsoft from Azure side:
13.107.6.0/24
13.107.9.0/24
13.107.42.0/24
13.107.43.0/24

Failed: can’t create session: could not connect to server: server selection error: server selection timeout, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: , Type: Unknown, Last error: connection() error occurred during connection handshake: connection(a[-58]) socket was unexpectedly closed: EOF }, { Addr: , Type: Unknown, Last error: connection() error occurred during connection handshake: connection(-56]) socket was unexpectedly closed: EOF }, { Addr: Type: Unknown, Last error: connection() error occurred during connection handshake: connection(a-60]) socket was unexpectedly closed: EOF }, ] }

Anybody has any idea, what am I missing?