[英]How can I substitute Azure App Configuration in a dev environment?
I want to use Azure App Configuration for runtime configuration for a docker container running .net core.我想使用 Azure App Configuration 为运行 .net 内核的 docker 容器进行运行时配置。
eg例如
var config = new ConfigurationBuilder()
.AddAzureAppConfiguration(options =>
{
...
)
.Build();
How can I seamlessly use a local service or overriding technique during development?如何在开发过程中无缝使用本地服务或覆盖技术?
A good analogy for this is using the Azure Storage Emulator, which runs locally, instead of the real cloud service.一个很好的类比是使用 Azure 存储模拟器,它在本地运行,而不是真正的云服务。
An idea I've had is to create a volume in a staging compose file and add a config file in it and the code checks to see if it's there.我的一个想法是在暂存撰写文件中创建一个卷并在其中添加一个配置文件,然后代码检查它是否存在。 If not, it'll use the Azure App Configuration service.如果没有,它将使用 Azure 应用程序配置服务。
You can use Environment variables.您可以使用环境变量。 In Dockerfile, you can configure different environment variables and ASP.NET Core can able to read from it.在 Dockerfile 中,您可以配置不同的环境变量,ASP.NET Core 可以从中读取。 You can find more details Configuration in ASP.NET Core您可以在 ASP.NET 内核中找到更多详细信息
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.