title: c# : A connection with the server could not be established
body: <p>I know this question has been asked multiple times, but couldn't find anything matching exactly to my scenario.  </p>
  
  <p>I have 2 Web APIs , say WebAPI1 and WebAPI2. WebAPI1 is developed using .Netcore and is deployed in Azure. WebAPI2 is developed using .NET framework 4.6.1 and is deployed in a Azure VM using IIS.  </p>
  
  <p>Now I have to make a request from WebAPI1 to WebAPI2. I have made a call to WebAPI2 using httpclient.  </p>
  
  <p>After hosting, when trying to make a request, it is throwing following error:</p>
  
  <blockquote>
    <p>the connection with the server could not be established.</p>
  </blockquote>
  
  <p>I have added ports 80 and 443 to the VM to the Inbound port rules. That didn't solve my problem. I'm guessing this might be a firewall issue. What things can I try to solve this?</p>
  
  <h2>Edit</h2>
  
  <p>The IP address of my VM is like 10.x.x.x. In IIS , I have added a application in default website with name : <code>WebAPI2</code>. In the web API I have controller method name <code>GetData()</code>.</p>
  
  <p>I have route prefix : <code>[RoutePrefix("api/App")]</code>. So the URL I'm using is <code>http://10.x.x.x/WebAPI2/api/App/GetData</code>.</p>