If you migrated to NET 8 and got this error, it's a breaking change:
https://learn.microsoft.com/en-us/dotnet/core/compatibility/containers/8.0/aspnet-port
that's why jakegb answer worked:
Use the EXPOSE instruction in your Dockerfile to expose port 8080.
Use the WEBSITES_PORT app setting with a value of "8080" to expose that port.