could you please telle me why if I set a config wi...
# dotnet
l
could you please telle me why if I set a config with "pulumi config set sql:username" in one stack then when I try to retrieve it from Program.cs the error is "Missing Required configuration variable ProjectNamesqlusername" ?
m
What does your code look like for accessing it?
l
var sqlusername = config.Require("sql:username"); var sqlpassword = config.RequireSecret("sql:password");
I don't know why it tries to concatenate also the project name to find the configuration...
m
When you create the
Config
class, it uses the Project name as the namespace...
If you want to access a different namespace, you'll have to instantiate a new instance of
Config
...
l
no I don't pass the parameter, ad so it means by default I think
m
Copy code
var sqlconfig = new Config("sql");
var sqlusername = sqlconfig.Require("username");
👍 1
l
ok so it means that if I have different namespaces in the same stack I need to instantiate different Config to be able to retrieve what i need, correct?
m
Correct.