'How to control the kestrel port during deployment?

During development I control the http and https ports using the launchSettings.json file as marked below:

enter image description here

Is it correct to use this same approach to control the kestrel port during deployment to production? Or do I need to make any port config in the appsettings.json or any other file?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source