{
  "$type": "site.standard.document",
  "canonicalUrl": "https://johnnyreilly.com/posts/azure-app-service-web-app-containers-asp-net-nested-configuration",
  "description": "Learn how to configure an ASP.NET application in Azure App Service Web App for Containers without colons. Use a double underscore instead.",
  "path": "/posts/azure-app-service-web-app-containers-asp-net-nested-configuration",
  "publishedAt": "2018-07-28T00:00:00.000Z",
  "site": "at://did:plc:yy3apqjlms24kso7ahn7lbmb/site.standard.publication/3mova7c4nho2b",
  "textContent": "How can we configure an ASP.NET application with nested properties Azure App Service Web App for Containers using Application Settings in Azure? Colons don't work.\n\n\n\nContainers on App Service\n\nApp Services have long been a super simple way to spin up a web app in Azure. The barrier to entry is low, maintenance is easy. It just works. App Services recently got a turbo boost in the form of Azure App Service on Linux. Being able to deploy to Linux is exciting enough; but another reason this is notable because you can deploy Docker images that will be run as app services.\n\nI cannot over-emphasise just how easy this makes getting a Docker image into Production. Yay Azure!\n\nThe Mystery of Configuration\n\nApplications need configuration. ASP.Net Core applications are typically configured by an appsettings.json file which might look like so:\n\nWith a classic App Service you could override a setting in the appsettings.json by updating \"Application settings\" within the Azure portal. You'd do this in the style of creating an Application setting called Parent:ChildOne or Parent:ChildTwo. To be clear: using colons to target a specific piece of config.\n\nYou can read about this approach here. Now there's something I want you to notice; consider the colons below:\n\nIf you try and follow the same steps when you're using Web App for Containers / i.e. a Docker image deployed to an Azure App Service on Linux  you cannot use colons:\n\nWhen you hover over the error you see this message: This field can only contain letters, numbers (0-9), periods (\".\"), and underscores (\"_\"). Using . does not work alas.\n\nHow do we configure without colons?\n\nIt's simple. Where you would use : on a classic App Service, you should use a __ (double underscore) on an App Service with containers. So Parent__ChildOne instead of Parent:ChildOne. It's as simple as that.",
  "title": "Azure App Service: nested configuration for ASP.NET running in Web App for Containers using Application Settings"
}