Anyone know if it is possible to reference your `a...
# azure
i
Anyone know if it is possible to reference your `azure-native:subscriptionId`variable from the yaml config from inside code?
config.get(subscriptionId)
would only look under the context of the project name
b
So the config is namespaced.
Copy code
const config = new pulumi.Config();
will give you config under the namespace of the project name
Copy code
const config = new pulumi.Config("azure-native");
const subscriptionId = config.get(subscriptionId);
will give you the azure-native config
💯 1
and if you ran
Copy code
pulumi config set mycustomnamespace:configitem
Then you'd use
Copy code
const config = new pulumi.Config("mycustomnamespace");
i
ahh, that is exactly what I was looking for, not sure why that thought didn't even cross my mind... Thanks!
t
A more general way - in case you don’t have it in your config - would be to all
getClientConfig
like in https://github.com/pulumi/examples/blob/2e9e18b36a9720dd0e691f2bfe883bbfd46bd512/azure-ts-synapse/index.ts#L63
That function returns a
subscriptionId
and some other parameters https://www.pulumi.com/docs/reference/pkg/azure-native/authorization/getclientconfig/