title: Custom port number for Azure cloud service
body: <p>I have an existing Azure cloud service which provides http and https endpoints. Everything is working well as far as that goes. I've recently been asked by another group to add an SSL endpoint on a special port to support something or other they're doing on their end. So, I added an extra endpoint in the service definition and redeployed. Here's my csdef now:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ServiceDefinition name="MyService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2013-10.2.2"&gt;
  &lt;WebRole name="MyService.WebAPI" vmsize="Large"&gt;
      &lt;Sites&gt;
        &lt;Site name="Web"&gt;
          &lt;Bindings&gt;
            &lt;Binding name="Endpoint1" endpointName="NonSSL Endpoint" /&gt;
            &lt;Binding name="Endpoint2" endpointName="SSL Endpoint" /&gt;
            &lt;Binding name="Endpoint3" endpointName="SSL 5200" /&gt;
          &lt;/Bindings&gt;
        &lt;/Site&gt;
      &lt;/Sites&gt;
      &lt;LocalResources&gt;
        &lt;LocalStorage name="localConfigStore" sizeInMB="1" /&gt;
      &lt;/LocalResources&gt;
      &lt;Endpoints&gt;
        &lt;InputEndpoint name="NonSSL Endpoint" protocol="http" port="80" /&gt;
        &lt;InputEndpoint name="SSL Endpoint" protocol="https" port="443" certificate="mycert" /&gt;
        &lt;InternalEndpoint name="InternalHttpIn" protocol="http" /&gt;
        &lt;InputEndpoint name="SSL 5200" protocol="https" port="5200" certificate="mycert" /&gt;
      &lt;/Endpoints&gt;
      &lt;Imports&gt;
        &lt;Import moduleName="Diagnostics" /&gt;
      &lt;/Imports&gt;
      &lt;ConfigurationSettings&gt;
        &lt;Setting name="LocalStorageAccount" /&gt;
      &lt;/ConfigurationSettings&gt;
      &lt;Certificates&gt;
        &lt;Certificate name="mycert" storeLocation="LocalMachine" storeName="My" /&gt;
      &lt;/Certificates&gt;
    &lt;/WebRole&gt;
  &lt;/ServiceDefinition&gt;
  </code></pre>
  
  <p>This deploys fine, and I'm able to query the service as usual on ports 80 and 443, but querying port 5200 gets me an immediate connection refused error:</p>
  
  <pre><code>PS C:\Users\user&gt; curl -k -v https://myservice.cloudapp.net:5200/api/health
  * Hostname was NOT found in DNS cache
  * Adding handle: conn: 0x4ae0a0
  * Adding handle: send: 0
  * Adding handle: recv: 0
  * Curl_addHandleToPipeline: length: 1
  * - Conn 0 (0x4ae0a0) send_pipe: 1, recv_pipe: 0
  *   Trying x.x.x.x...
  * connect to x.x.x.x port 5200 failed: Connection refused
  * Failed to connect to myservice.cloudapp.net port 5200: Connection refused
  * Closing connection 0
  curl: (7) Failed to connect to myservice.cloudapp.net port 5200: Connection refused
  PS C:\Users\user&gt;
  </code></pre>
  
  <p>If I look at the deployed service in the Azure management console I see all three endpoints, so I don't think I've made an egregious error in my config... Is there something else I need to do to open that port to the outside world? Or are nonstandard ports not allowed by Azure?</p>