https://pulumi.com logo
Title
d

damp-cartoon-25024

12/14/2022, 9:28 AM
Okay, this is weird to me. I'm setting a config setting:
pulumi config set azure:subscriptionId 12345678-1234-1234-1234-123456789abc
And using it in code:
_currentId = config.require("azure:subscriptionId");
Which fails
error: Missing required configuration variable 'app:azure:subscriptionId'
        please set a value using the command `pulumi config set app:azure:subscriptionId <value>`
Where did the
app:
come from? The command it suggests fails as well:
~#@❯ pulumi config set app:azure:subscriptionId 12345678-1234-1234-1234-123456789abc
error: invalid configuration key: could not parse app:azure:subscriptionId as a configuration key (configuration keys should be of the form `<namespace>:<name>`)
What am I missing?
l

limited-rainbow-51650

12/14/2022, 9:47 AM
@damp-cartoon-25024 am I right
app
is your project name? This is for config the default namespace. If you want to retrieve
subscriptionId
from the
azure
namespace, you have to create a separate config object for the
azure
namespace first, then retrieve the right key:
const azureConfig = new pulumi.Config("azure");
const subscription = azureConfig.require("subscriptionId");
d

damp-cartoon-25024

12/14/2022, 9:55 AM
Ah! That makes sense! Now I get where I went wrong. Thanks!