Store the API key and config in Environment Variables (or any other secure vault)
xuanphuoc92 opened this issue · 2 comments
Hi. Thank you, the components work well on my playground, but I would like to check if the components work with Environment Variables? Like instead of setting in the appsetting json file, I can set in the Environment Variables with keys like SmartComponents__ApiKey and SmartComponents__DeploymentName, right?
(Will try out and test later, if there's any new would report here)
Thank you again. Great work!
You can indeed store the SmartComponents
config values in environment variables, files, a database or anywhere else.
This facility is inherited from ASP.NET Core's built-in config system. Full docs are at https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-8.0
To read config from environment variables, you'd use builder.AddEnvironmentVariables
, picking your own prefix name, as shown in the docs there.
I'll close this since the feature is already there and is implemented in ASP.NET Core itself.
Thank you. Just want to report about how it was tested out. Work like a charm: https://peter-do-stuff.azurewebsites.net/smartComponent
Setting Environment Variables SmartComponents__ApiKey
and SmartComponents__DeploymentName
on Azure portal turns out working as expected.