.net 6 升級到 .net 8 Azure App Service 踩坑紀錄

  1. 升级运行环境的 docker file:
    请务必先参考 https://hub.docker.com/_/microsoft-dotnet-aspnet/,.net 6用的是 6.0-bullseye-slim,.net 8 已经没有了bullseye,最新的是bookworm, 所以应该使用8.0-bookworm-slim.

  2. 运行在Azure App Service (Contanier):
    刚开始发布到Cloud,发现整个容器无法访问,但又没有出现 deploy error, 换回 .net 6 又正常。因本地使用 Visual Stuido 运行时一切正常,经反复对比两个环境,发现运行 .net 8 时 Visual Stuido 容器窗口下的 Environment Variables 列表里多了一个变量ASPNETCORE_HTTP_PORTS: 8080, 将其手动添加到云端后一切恢复正常。

未完待续。。。

posted on 2023-11-17 15:07  BadTree  阅读(136)  评论(0编辑  收藏  举报