title: CyberSource on Azure
body: <p>To do a request with CyberSource service you have to append .p12 certificate in request.</p>
  
  <p>Classic way of appending(CyberSource SDK):</p>
  
  <pre><code>    req.ClientCertificates.Add(new X509Certificate2(@"D:\cert\cert.p12", "password1"));
  </code></pre>
  
  <p>This works perfectly on local or dedicated hosting.</p>
  
  <p>The issue is we need to append .p12 certificate on Azure, which is impossible in classic way.</p>
  
  <p>I've tried to put it in wwwroot/App_Data and load, but it doesn't work since, error from server we get is:</p>
  
  <blockquote>
    <p>502 - Web server received an invalid response while acting as a
    gateway or proxy server. There is a problem with the page you are
    looking for, and it cannot be displayed. When the Web server (while
    acting as a gateway or proxy) contacted the upstream content server,
    it received an invalid response from the content server.</p>
  </blockquote>
  
  <p>I've read here, how to use cert on azure(changed p12 to pfx and uploaded to Azure):
  <a href="https://azure.microsoft.com/en-gb/blog/using-certificates-in-azure-websites-applications/" rel="nofollow">https://azure.microsoft.com/en-gb/blog/using-certificates-in-azure-websites-applications/</a></p>
  
  <p>But I am not sure, this is correct way.</p>