title: How to deploy package to Azure Web App using MSDeploy extension? (The value for one of the HTTP headers is not in the correct format)
body: <p>I am trying to build a very simple Azure Resource Manager template to provision an App Service Plan, a Web App and immediately deploy package there using MSDeploy. I created a Resource Group project in Visual Studio and added Web App and MSDeploy extension. I basically followed this article: <a href="http://blogs.technet.com/b/georgewallace/archive/2015/05/10/deploying-a-website-with-content-through-visual-studio-with-resource-groups.aspx" rel="nofollow noreferrer">http://blogs.technet.com/b/georgewallace/archive/2015/05/10/deploying-a-website-with-content-through-visual-studio-with-resource-groups.aspx</a>. I haven't customized deployment PowerShell script which comes with the project.</p>
  
  <p>Here is the template: <a href="http://pastebin.com/raw/aFsMyg1W" rel="nofollow noreferrer">http://pastebin.com/raw/aFsMyg1W</a></p>
  
  <p>Everything looks like it should work (package is uploaded to blob, web app is created), but deployment fails with message:</p>
  
  <blockquote>
    <p>Resource Microsoft.Web/sites/extensions 'xg-test-webapp5/MSDeploy' failed with message 'The resource operation completed with terminal provisioning state 'Failed'.</p>
  </blockquote>
  
  <p>There is an error message accessible via Kudu console (<code>LogFiles/SiteExtensions/MSDeploy/appManagerLog.xml</code>):</p>
  
  <blockquote>
    <p>AppGallery Deploy Failed:  'Microsoft.WindowsAzure.StorageClient.StorageClientException: The value for one of the HTTP headers is not in the correct format</p>
  </blockquote>
  
  <p>Full log:</p>
  
  <p><a href="https://i.stack.imgur.com/iRyuK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iRyuK.png" alt="full log"></a></p>
  
  <p>Just for the reference, here is the content of the blob where the package was uploaded. It can be seen that it is accessible at the correct URL.</p>
  
  <p><a href="https://i.stack.imgur.com/7495X.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7495X.png" alt="blob"></a></p>
  
  <p>Any idea what is happening? Thanks</p>