Azure Functions:强制 HTTPS [英] Azure Functions: Force HTTPS
问题描述
Azure Functions 是否有办法强制通过 HTTPS 进行连接?
Is there a way with Azure Functions to force connections to be over HTTPS?
我没有在应用设置中看到它,也没有看到对 Azure Functions 的 web.config 的任何引用.
I'm not seeing it in the App Settings, and I don't see any reference to web.config for Azure Functions.
推荐答案
2017 年 11 月更新
在 Azure 门户中,转到您的函数应用.
In the Azure portal, go to your function app.
平台功能 > 自定义域 > 将 HTTPS Only 切换为开启".
Platform features > Custom Domains > toggle HTTPS Only to 'On'.
任何使用 HTTP 的人都会收到 301 Moved Permanently 并被重定向到 HTTPS 端点.您不需要实际添加新的主机名/域来切换此功能.这似乎适用于消费和应用服务计划.
Anyone using HTTP will receive a 301 Moved Permanently and be redirected to the HTTPS endpoint. You do not need to actually add a new hostname/domain to toggle this feature. This appears to work with both consumption and app service plans.
这篇关于Azure Functions:强制 HTTPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!