简体   繁体   中英

Problem deploying pfx certificate with ARM to Azure, InternalServerError

So, I'm trying to deploy a certificate to Azure using ARM template (currently using bicep). I have received my.cer files from Sectigo, generating a pfx file using openssl seems to work fine since the generated pfx is possible to add using the Azure portal on my FunctionApp. But when I try to deploy it using ARM template I get this error:

{
  "code":"DeploymentFailed",
  "message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.",
  "details": [
    {
      "code":"InternalServerError",
      "message":"There was an unexpected InternalServerError. Please try again later. x-ms-correlation-request-id: f25b9b70-e931-4e19-b010-cc1907cdcbcc"
    }
  ]
}

The deployment looks like this:

{
  "type": "Microsoft.Web/certificates",
  "apiVersion": "2016-03-01",
  "name": "xxx20220609",
  "location": "[resourceGroup().location]",
  "properties": {
    "pfxBlob": "[parameters('certificatePfx')]",
    "password": "[parameters('certificatePassword')]"
  }
}

The certificatePassword is provided as a parameter and is the same as when I import it manually. The certificatePfx is found just reading the bytes from the pfx file and base64 encoding it, which I've done using C#:

Convert.ToBase64String(File.ReadAllBytes(@"[pfx-file-path]"))

Any idea on what the InternalServerError could be about?

Please check once the below points as, I was doing the below mistakes in my test application:

• In my environment I discovered that the certificate binding to the host's name must be done via two templates instead of one because we cannot have two operations against the same type within an ARM template.

• Even I was getting a subsequent validation error which was occurring due to the domain name containing upper case letters. Once I altered that, I was successfully able to issue an app service with a managed certificate via an ARM template.

Funny thing. Tried exporting the certificate again, with another password. This time it worked

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM