This post explores 8 different ways to set the URLs for an ASP.NET Core app, including using the `UseUrls()` method, adding URLs directly to `WebApplication.Urls`, using environment variables, command line arguments, configuration files (`appsettings.json` and `launchSettings.json`), and configuring Kestrel server options. Each method offers different levels of control and is suitable for different scenarios.
Table of contents
What URLs can you use?UseUrls()WebApplication.Urls and WebApplication.Run()Environment variables for the URLEnvironment variables for the portsCommand line argumentsappsettings.jsonlaunchSettings.jsonKestrelServerOptions.Listen()SummarySort: