Skip to content
Discussion options

You must be logged in to vote

That's not how you'd go about testing multiple environments. You don't need to copy this verbatim but you need to switch based on something:

builder.Configuration.AddCommandLine(args, new Dictionary<string, string> { ["--target"] = "Deployment:Target" });
var target = builder.Configuration["Deployment:Target"];
var publisher = builder.ExecutionContext.PublisherName;
IResourceBuilder<IComputeEnvironmentResource>? environment = (publisher, target) switch
{
("default", "kube") => builder.AddKubernetesEnvironment("env"),
("default", "azure") => builder.AddAz…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@mastoj
Comment options

@davidfowl
Comment options

Answer selected by mastoj
Comment options

You must be logged in to vote
1 reply
@davidfowl
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants
Converted from issue

This discussion was converted from issue #9545 on May 29, 2025 05:45.