title: Connecting to Azure Batch behind proxy - Operation returned an invalid status code 'Forbidden'
body: <p>I've set up an Azure Batch account and am trying to use the C# HelloWorld example from here,</p>
  
  <p><a href="https://github.com/Azure/azure-batch-samples" rel="nofollow noreferrer">https://github.com/Azure/azure-batch-samples</a></p>
  
  <p>After filling in the Batch and storage account details in AccountSettings.settings this works fine if I'm outside of my corporate network (which is behind a proxy server). However, when using the exact same code from behind the proxy server I'm getting,</p>
  
  <pre><code>BatchException: Operation returned an invalid status code 'Forbidden'
  </code></pre>
  
  <p>and in the console output the following,</p>
  
  <pre><code>C:\Source\Scratch\Azure-batch-samples\CSharp\GettingStarted\01_HelloWorld\bin\Debug&gt;HelloWorld.exe
  Running with the following settings:
  -------------------------------------
  PoolId = HelloWorld-Pool
  PoolTargetNodeCount = 2
  PoolOSFamily = 4
  PoolNodeVirtualMachineSize = small
  ShouldDeleteJob = True
  
  BatchAccountName = &lt;censored&gt;
  BatchAccountKey = &lt;censored&gt;
  BatchServiceUrl = &lt;censored&gt;
  StorageAccountName = &lt;censored&gt;
  StorageAccountKey = &lt;censored&gt;
  StorageServiceUrl = &lt;censored&gt;
  
  Deleting job: HelloWorldJob-809362-20180126-143309
  Microsoft.Azure.Batch.Common.BatchException: Operation returned an invalid status code 'Forbidden' ---&gt; Microsoft.Azure.
  Batch.Protocol.Models.BatchErrorException: Operation returned an invalid status code 'Forbidden'
     at Microsoft.Azure.Batch.Protocol.JobOperations.&lt;DeleteWithHttpMessagesAsync&gt;d__6.MoveNext()
  --- End of stack trace from previous location where exception was thrown ---
  
  &lt;..snip..&gt;
  
  Request Information
  ClientRequestId:
  RequestId:d8b9fcc6-b32d-437c-a8af-7d44d6df486d
  HttpStatusCode:Forbidden
  StatusMessage:Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly
   including the signature.
  
  
  Error Code = AuthenticationFailed, Lang=en-US, Message = Server failed to authenticate the request. Make sure the value
  of Authorization header is formed correctly including the signature.
  RequestId:d8b9fcc6-b32d-437c-a8af-7d44d6df486d
  Time:2018-01-26T13:33:13.9958126Z
  Additional Values:
  Error Details key=AuthenticationErrorDetail value=The MAC signature found in the HTTP request 'k4mfqD3FP6FL2nWLgR3E6AxRp
  JJAse9vRW1qVOnn1K0=' is not the same as any computed signature. Server used following string to sign: 'DELETE
  </code></pre>
  
  <p>Does anyone know what's happening here?</p>