Parameters with multiple values #3307
Replies: 3 comments 8 replies
-
Doesn’t work. Parameters are single values. What would you expect to happen during deployment? Would you be prompted for many values? You should be able to build this using the a custom resource that internally uses parameters (parameter set?). We’re currently missing a way to explicitly set the parameter value outside of configuration at runtime (cc @mitchdenny @eerhardt), but you could imagine reading the entire config section, and storing a parameter for each value under it. Then there would be a WithReference overload that took a parameter set and set environment variables for each value in the set. |
Beta Was this translation helpful? Give feedback.
-
To work that way, I've written the follow extension:
That way you can declare the appsettings like that:
Register on apphost like that
And use in your project as usual:
This way we can handle multiple levels :) |
Beta Was this translation helpful? Give feedback.
-
As this is written at deployment time (if you deploy) the manifest will just use whatever values you have at runtime. If you want it to noop then you can check the execution context for the mode . |
Beta Was this translation helpful? Give feedback.
-
Is there a way to setup the parameter with multiple values like this?
appsettings.json
AppHost.Program.cs
I was expecting that we could use it like that, and it would automatically expand to each individual environment like:
ApiSettings_BaseUrl
ApiSettings_SomeOther
SystemSettings_AdminUrl
However, it doesn't seem to work like that.
Beta Was this translation helpful? Give feedback.
All reactions