微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在 Azure Functions PowerShell 运行时本地 Docker 映像中使用 HTTPS

如何解决在 Azure Functions PowerShell 运行时本地 Docker 映像中使用 HTTPS

我正在使用 Docker 容器在 PowerShell 运行时本地测试 Azure Functions。当我使用 func start -p 8080 --useHttps 时。我能够生成 URL https://localhost:8080/api/HttpExample 但是当使用 docker run -p 8080:443 azurefunctionsimage:v1.0.0 时。我可以看到只为 HTTP 而不是 HTTPS

生成链接的日志

logs screenshot

]1

请指导我如何使用 Docker Container 在 HTTPS 上运行这个 azure 函数

参考网址:

https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-function-linux-custom-image?tabs=bash%2Cportal&pivots=programming-language-powershell

我对 ASP.net 也不熟悉,但此链接能帮助我实现这一目标吗?

https://docs.microsoft.com/en-us/aspnet/core/security/docker-https?view=aspnetcore-5.0#macos-or-linux

解决方法

正如 Charles Xu 在他的评论中所说:You need to enable the HTTPS in the image with the Web Server,such as the IIS.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。