title: Mongo Connection Error in Azure Linux App Service using docker image
body: <p>I've deployed a docker image to an Azure Linux App Service which contains a node app. The app is failing to start properly because it can't connect to a Mongo version of Cosmo DB.</p>
  
  <blockquote>
    <p>error:  MongoError: failed to connect to server [***.documents.azure.com:10255] on first connect [MongoError: getaddrinfo EAI_AGAIN ***.documents.azure.com:10255]</p>
  </blockquote>
  
  <p>I'm using mongoose and the following to connect:</p>
  
  <pre><code>mongoose.connect(process.env.MONGODB_URL, { useMongoClient: true });
  </code></pre>
  
  <p>Running the app in a container locally on my machine works. Is there something I'm missing? Some DNS/Firewall setting?</p>
  
  <p>Dockerfile:</p>
  
  <pre><code>FROM mhart/alpine-node:latest
  
  # Create app directory
  WORKDIR /usr/src/app
  
  # Install app dependencies
  COPY package.json package-lock.json ./
  
  RUN npm install --production
  
  # Bundle app source
  COPY . .
  
  EXPOSE 4000
  
  CMD [ "node", "main.js" ]
  </code></pre>