我需要一种机制来从 Keyvault 下载 .pfx 证书,然后将其上传到 Azure 容器环境,这一切都通过 Bicep 进行。这将最大限度地减少更新证书时的任何手动干预。
我目前正在使用使用 powershell 手动转换的 base64 编码值将证书添加到我的 Azure 容器环境。如下:
resource certificate 'Microsoft.App/managedEnvironments/certificates@2022-06-01-preview' = {
parent: env
location: location
name: 'ta-cert'
properties: {
password: certificatePassword
value: '<base64>'
}
}
Run Code Online (Sandbox Code Playgroud)
我想尝试实现的是从 Keyvault 下载 pfx 文件并在 Bicep 文件中将其转换为 base64(可能通过使用嵌入在 bicep 中的 powershell 命令),然后可以在上面的代码中使用。
如果有人以前这样做过,将非常感激看到其实施。
azure azure-resource-manager azure-keyvault azure-bicep azure-container-apps