【Azure 应用服务】 在App Service中无法上传证书[Private Key Certificates (.pfx)],导入Azure Key Vault中的证书也无法成功

简介: 【Azure 应用服务】 在App Service中无法上传证书[Private Key Certificates (.pfx)],导入Azure Key Vault中的证书也无法成功

问题描述

在App Service的TLS/SSL settings页面,切换到Private Key Certificates (.pfx),通过Import Key Vault Certificate方式上传证书,提示成功,实际没有上传成功。通过Upload Certificate的方式上传证书,输入正确的密码,提示失败。使用Import Key Vault Certificate,导入Key Vault中的证书,也无法成功。

 

问题解答

在查看App Service的操作日志后,发现问题原因是当前的App Service执行过Move Resource Group的操作,而上传证书的绑定到新的Resource Group所在的WebSpace,而不是App Service所在的WebSpace,因为WebSpace在最开始创建后,就无法修改。移动到其他资源组的时候也不会修改App Service的WebSpace。

 

英文解释如下:

Site 'app service name' was originally created in 'old group name xxx' resource group, but later moved to 'new group name ***' resource group. If you are trying to import certificate to this site, then the certificate will be in the WebSpace of 'new group name ***' resource group. But your website will still be in 'old group name xxx' resource group and hence will not be able to use the imported certificate.

Recommendation:

Try importing certificate from another site that is still in the original  'old group name xxx' resource group. Or upload this certificate to right WebSpace using this below CLI command:

• az webapp config ssl import --name WebsiteName --resource-group WebsiteRGName --key-vault MyKeyVault --key-vault-certificate-name MyCertificateName

• az webapp config ssl upload --name WebsiteName --resource-group WebsiteRGName --certificate-file MyPfx.pfx --certificate-password Mypassword

如果不使用上面的指令,则可以使用如下的步骤来导入证书:

  1. 在旧的Resource Group 中新建一个App Service, 位于同样的区域中,并且和目标App Service使用同样的Operating System
  2. 在新建的App Service中上传 Key Vault中的证书
  3. 在目标App Service中确认可以看到证书
  4. 删除新建的Web app
  5. 再次在目标App Service中确认可以看到证书并正常使用

 

 

[END]

相关文章
|
3月前
|
存储 安全 Linux
【Azure App Service】在App Service中查看CA证书
在 Azure App Service 中,使用自签名或私有 CA 证书的远程服务可能会导致 SSL 握手失败。解决方法包括使用受信任 CA 签发的证书,或通过 App Service Environment 加载自定义根证书,实现安全连接。
|
14天前
|
Java 应用服务中间件 API
【App Service】部署War包到Azure云上遇404错误
Java应用部署至Azure App Service for Windows后报404,本地运行正常。经排查,日志提示类文件版本不兼容:应用由Java 17(class file version 61.0)编译,但环境仅支持到Java 11(55.0)。错误根源为Java版本不匹配。调整App Service的Java版本至17后问题解决,成功访问接口。
|
1月前
|
存储 Linux 网络安全
【Azure App Service】Root CA on App Service
Azure App Service for Windows应用连接外部SSL服务时,需确保其证书由受信任的根CA颁发。多租户环境下无法修改根证书,但ASE(单租户)可加载自定义CA证书。若遇证书信任问题,可更换为公共CA证书或将应用部署于ASE并导入私有CA证书。通过Kudu的PowerShell(Windows)或SSH(Linux)可查看当前受信任的根证书列表。
92 13
|
2月前
|
网络协议 Java Linux
【App Service】在Azure环境中如何查看App Service实例当前的网络连接情况呢?
在 Azure App Service(Windows 和 Linux)中部署应用时,分析网络连接状态是排查异常、验证端口监听及确认后端连接的关键。本文介绍如何在 Linux 环境中使用 `netstat` 命令查看特定端口(如 443、3306、6380)的连接情况,并解析输出结果。同时说明在 Windows App Service 中 `netstat` 被禁用的情况下,如何通过门户抓包等替代方法进行网络诊断。内容涵盖命令示例、操作步骤及附录说明,帮助开发者快速掌握云环境中的网络分析技巧。
72 11
|
开发工具 数据安全/隐私保护 安全
远程调试 Azure Web App
当我们将 Web App 部署在 Azure 上时,如果能够实现远程调试,将会极大的提高我们修复 bug 的效率。Visual Studio 一贯以功能强大、易用著称,当然可以实现基于 Azure 应用的创建、发布和调试。
1243 0
|
25天前
|
缓存 移动开发 JavaScript
如何优化UniApp开发的App的启动速度?
如何优化UniApp开发的App的启动速度?
325 139

热门文章

最新文章