简体   繁体   English

如何在开发环境中替换 Azure 应用程序配置?

[英]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.

相关问题 如何提前获取 Azure 应用服务中的配置? - How Can I Get Early Access to Configuration in Azure App Service? 如何配置 Azure Function 以使用 Azure 应用程序配置进行动态配置? - How can I configure an Azure Function to work with dynamic configuration using Azure App Configuration? 我们如何在开发环境中将Azure环境网站移至实际环境中 - How we can move azure environment website in live environment from dev environment 如何使用Azure Oauth App注册为每个环境(本地/开发/测试/产品)使用不同的URL - How do I have differing URLs for each environment (local/dev/test/prod) using Azure Oauth App Registrations Azure 应用程序配置推送任务 - 如何使用此任务在 azure 应用程序配置中部署密钥保管库参考值? - Azure App Configuration Push Task - How can I deploy key vault reference values in azure app configuration using this task? Windows Azure:如何将配置设置公开为环境变量? - Windows Azure: how do I expose a configuration setting as an environment variable? Azure开发人员部署期间的Azure Web应用程序配置设置 - Azure web app configuration settings during azure dev ops deployment 如何使用应用服务环境在 Azure 上设置私有 Web 应用 - How can i set up a private web app on Azure using an App Service Environment 我无法从我的 REACT 应用程序的 azure 应用程序服务配置中读取环境变量 - I am having trouble of reading environment variable from azure app service configuration for my REACT app 我无法从我的 REACT 应用程序中读取 azure 应用程序服务配置的环境变量 - I am unable to read environment variable from azure app service configuration from my REACT app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM