在带有Node.js的Azure函数应用中使用SSL证书 [英] Use SSL certificate in azure function app with nodejs

查看:100
本文介绍了在带有Node.js的Azure函数应用中使用SSL证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将.pfx证书上传到了我的功能应用程序。
如何加载此证书,以便可以在Nodejs代码中使用它?
如果将其放在项目目录中,则可以使用它,并且可以正常工作,但是我想避免在项目中使用它。

I uploaded a .pfx certificate to my function app. How do I load this certificate so I can use it in my Nodejs code? If I put it in the project directory I am able to use it and it works fine but I would like to avoid to have it in the project.

谢谢。

推荐答案

在Azure门户中,您可以按照下图上载私人证书 .pfx 文件,然后进行SSL绑定。

In Azure portal, you can follow the figures below to upload your private certificate .pfx file and next to do the SSL binding.

图1.选择您的Function App并移至 Platform features 标签以单击 SSL 按钮。

Fig 1. Select your Function App and move to Platform features tab to click SSL button.

图2.然后,选择 Private Certificates(.pfx)选项卡单击上传证书
按钮,然后在右侧对话框窗口中上传您的 .pfx 文件。

Fig 2. Then, select Private Certificates (.pfx) tab to click Upload Certificate button and next to upload your .pfxfile in the right dialog window.

图3.移至绑定标签,然后点击添加SSL绑定按钮,以在右侧对话框窗口中选择您上传的证书。

Fig 3. Move to Bindings tab and click Add SSL Binding button to select your uploaded cert in the right dialog window.

然后,您可以参考官方文档 为Azure App Service配置TLS相互身份验证 要了解如何在Node.js代码中配置和启用SSL认证功能,请参见其 Node.js示例

Then, you can refer to the offical document Configure TLS mutual authentication for Azure App Service to know how to configure and enable SSL authenticatication feature in your Node.js code, see its Node.js sample.

还有其他官方文档也可能会有所帮助。

There are other offical documents also may helps.


  1. 在应用程序代码中使用SSL证书在Azure应用服务中

  2. 教程:绑定现有的自定义SSL证书到Azure App Service

  3. 购买并配置Azure应用服务的SSL证书

  1. Use an SSL certificate in your application code in Azure App Service
  2. Tutorial: Bind an existing custom SSL certificate to Azure App Service
  3. Buy and configure an SSL certificate for Azure App Service

这篇关于在带有Node.js的Azure函数应用中使用SSL证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆