instead of using the default, add the configuration providers in your code.
// defaults
var builder = WebApplication.CreateBuilder(args);
// remove config sources
builder.Configuration.Sources.Clear();
// add config providers in order you want:
builder.Configuration.AddEnvironmentVariables();
...