title: No connection could be made because the target machine actively refused it when connecting to an Azure IP
body: <p>When connecting to an Azure active directory service (see code below) I promptly receive the error:</p>
  
  <p><code>No connection could be made because the target machine actively refused it 191.235.135.139:443</code></p>
  
  <p>Having googled the IP it resolves to a Azure data centre based in Ireland. Though what's <strong>really odd</strong> is as the IPs change from time to time, yesterday the Azure IP of 191.235.195.38:443 worked without any issues?</p>
  
  <pre><code>public partial class Startup
  {
      public void ConfigureAuth(IAppBuilder app, HttpConfiguration config)
      {
          app.UseWindowsAzureActiveDirectoryBearerAuthentication(
              new WindowsAzureActiveDirectoryBearerAuthenticationOptions
              {
                  Audience = CloudConfigurationManager.GetSetting("AzureActiveDirectoryInstance"),
                  Tenant = CloudConfigurationManager.GetSetting("Tenant"),
                  Provider = new QueryStringOAuthBearerProvider("AUTHORIZATION")
              });
  
          app.UseWebApi(config);
      }
  }
  </code></pre>
  
  <p>I've searched high and low for answers, trying a whole range of suggestions such as checking nothing is using port 443 (the fact it tells me the target machine actively refused the connection leads me to believe that it's able to reach the machine).</p>
  
  <p>I thought it could be to do with the Azure firewall but I have other colleagues that are able to connect to the service that are on the same public IP address.</p>
  
  <p>Has anyone experienced this before when trying to connect to an Azure service?</p>