Based on our offline discussions. Updating the thread with answers to benefit the community.
Do I need to use the PORT variable still in code, this restriction was supposed to be removed with GA?
You don’t need to use the PORT variable.
The automatic port detection detects the port (port 80 is the default), we will attempt to detect which port to bind to your container, but you can also use the WEBSITES_PORT app setting and configure it with a value for the port you want to bind to your container. However, the web server in your custom image may use a port other than 80. You tell Azure about the port that your custom container uses by using the WEBSITES_PORT app setting. For a different port - Use the EXPOSE instruction in your Dockerfile to expose the appropriate port (E.g 5000) and use the WEBSITES_PORT app setting on Azure with a value of "5000" to expose that port.
Do I need to use WEBSITES_PORT? This was also not supposed to be required as Azure was supposed to "auto-detect" my port I am listening on.
Kindly use app setting WEBSITES_PORT to set the port for your own docker image (from dockerhub/ACR/private registry)
https://learn.microsoft.com/azure/developer/python/tutorial-deploy-containers-02
Can I use ASPNETCORE_URLS in the DOCKER image, currently this is ignored but this is the preferred way from the ASP.NET Core development team.
You can just overwrite that environmental variable before aspnetcore app starts.
If there is an init.sh script:
export ASPNETCORE_URLS=<What you’d like it to be>
https://learn.microsoft.com/en-us/azure/app-service/containers/app-service-linux-faq#built-in-images
Overriding ASPNETCORE_URLS variable was identified as bug, (with Linux App Service using VNet integration and managed identity) a fix will be deployed soon, but not sharing ETA at this time.