Azure App Config - Conditional

Rajarajacholan Krishnamurthy 21 Reputation points

How can I let my application to use appsettings.json file when I run it on my local computer and use Azure App Config keys when it is deployed in cloud?

Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
206 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Udaiappa Ramachandran 726 Reputation points MVP

    I assume you are referring to .NET core applications; if so you can use appsettings.Development.json for local dev

    var builder = new ConfigurationBuilder()
    .AddJsonFile("appsettings.json", false, true)

    if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == Environments.Development)


    0 comments No comments