See the documentation for various ways of configuring a non-default HTTPS port.
Which approach suits your scenario best depends on how your application is set up and hosted. You could for example add a setting:
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseSetting("https_port", "5001")
.UseStartup<Startup>();