title: WCF configuration/authentication not working in Azure
body: <p>I'm trying to call an external service that has Windows authentication, it works fine from my Windows development machine running in IIS but once I publish the site to Azure it can't authenticate with the service even if the configuration is the same. The error I get back is,</p>
  
  <pre><code>System.ServiceModel.Security.MessageSecurityException:
  The HTTP request is unauthorized with client authentication scheme 'Negotiate'.
  The authentication header received from the server was 'Negotiate'. ---&gt;
  System.Net.WebException: The remote server returned an error: (401) Unauthorized.
  </code></pre>
  
  <p>It feels like in Azure it's not even trying the authenticate.</p>
  
  <p>The configuration for the service looks like this,</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;bindings&gt;
          &lt;basicHttpBinding&gt;
              &lt;binding name="Custom_Binding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferPoolSize="524288" receiveTimeout="00:20:00" sendTimeout="00:20:00"&gt;
                  &lt;readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt;
                  &lt;security mode="TransportCredentialOnly"&gt;
                      &lt;transport clientCredentialType="Windows" /&gt;
                  &lt;/security&gt;
              &lt;/binding&gt;
          &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
          &lt;endpoint address="http://www.otherdomain.com/webServiceRequest" binding="basicHttpBinding" bindingConfiguration="Custom_Binding" contract="webServiceRequest_Port" name="webServiceRequest_Port" /&gt;
      &lt;/client&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>This is the c# code that makes the request,</p>
  
  <pre><code>var client = new webServiceRequest_PortClient();
  client.ClientCredentials.UserName.UserName = "domain\Username";
  client.ClientCredentials.UserName.Password = "Password";
  var response = await client.PerformServiceAsync(method, request);
  </code></pre>
  
  <p>/Viktor</p>