Appsettings.json and Secrets.json in Pulumi. What ...
# dotnet
Appsettings.json and Secrets.json in Pulumi. What are the best practices for using
in C# Pulumi projects? My scenario is that I want to use a connection string for a resource on a completely different resource group. not controlled by pulumi as an application setting for my azure app service. I want to store the value of this connection string in
like I would for any typicaly .net application. The only docs I can find is this but this simply says "_With some configuration not shown here, the properties are filled at startup_", but it is the stuff that is not shown that I would love to see.
I believe the part that says With some configuration not shown here... is referencing the fact that you'd need to load the configuration(s) yourself through something like:
Copy code
new ConfigurationBuilder
  .AddJsonFile("appSettings.json", true, true)
You'd then be able to load the configuration details into a POCO, where the rest of your app is free to use it.
Yes, you should wire up config as you would outside of Pulumi.
This really comes together when using the dotnet automation api, then you can bypass pulumi config altogether, and just use dotnet config sources. You would have something similar and wire up
config source.
👍 1