title: Importing a certificate to Azure key vaullt: Operation returned an invalid status code 'Conflict'
body: <p>I am trying to import a .PFX file (first converted to base64 file), into Azure Keyvault, with the code below.</p>
  
  <p>However I get the error: Operation returned an invalid status code 'Conflict'</p>
  
  <p>There are absolutely no other certificates on the Azure KeyVault.</p>
  
  <pre><code> public async Task ImportCertificate(string base64FileCertFile, string CertPasswordText, string name)
          {
              AzureServiceTokenProvider azureServiceTokenProvider = new AzureServiceTokenProvider();
              KeyVaultClient keyVaultClient = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(azureServiceTokenProvider.KeyVaultTokenCallback));
  
              Message = "Your application description page.";
              int retries = 0;
  
              //byte[] fileData = null;
              //using (var binaryReader = new BinaryReader(request.Files[0].InputStream))
              //{
              //        fileData = binaryReader.ReadBytes(request.Files[0].ContentLength);
              //}
  
              //var base64EncodedCertificate = Convert.ToBase64String(fileData);
              bool retry = false;
              try
              {
                  /* The below do while logic is to handle throttling errors thrown by Azure Key Vault. It shows how to do exponential backoff which is the recommended client side throttling*/
                  do
                  {
                      long waitTime = Math.Min(GetWaitTime(retries), 2000000);
                      var result = await keyVaultClient.ImportCertificateAsync(ConfigurationManager.AppSettings["VaultUrl"].ToString(), name, base64FileCertFile, CertPasswordText);
  
                      Message = result.Id;
                      retry = false;
                  }
                  while (retry &amp;&amp; (retries++ &lt; 10));
               }
              /// &lt;exception cref="KeyVaultErrorException"&gt;
              /// Thrown when the operation returned an invalid status code
              /// &lt;/exception&gt;
              catch (KeyVaultErrorException keyVaultException)
              {
                  Message = keyVaultException.Message;
                  if ((int)keyVaultException.Response.StatusCode == 429)
                      retry = true;
              }
          }
  </code></pre>