将带有ARM的pfx证书部署到Azure时出现问题,InternalServerError



因此,我正尝试使用ARM模板(目前使用bicep(将证书部署到Azure。我已经从Sectigo收到了我的.cer文件,使用openssl生成pfx文件似乎很好,因为生成的pfx可以使用我的FunctionApp上的Azure门户添加。但当我尝试使用ARM模板部署它时,我会收到以下错误:

{
"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"
}
]
}

部署如下:

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

certificatePassword是作为参数提供的,与我手动导入时相同。certificatePfx只是从pfx文件中读取字节并对其进行base64编码,这是我使用C#:完成的

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

你知道InternalServerError可能是关于什么的吗?

请检查以下几点,因为我在测试应用程序中犯了以下错误:

•在我的环境中,我发现绑定到主机名的证书必须通过两个模板而不是一个模板来完成,因为在ARM模板中不能对同一类型执行两个操作。

•甚至我也收到了一个后续的验证错误,该错误是由于域名包含大写字母而发生的。一旦我改变了这一点,我就能够通过ARM模板成功地向应用程序服务颁发托管证书。

有趣的事情。尝试使用另一个密码再次导出证书。这一次它工作

最新更新