azure application settings - how to add nested item

后端 未结 2 1125
忘掉有多难
忘掉有多难 2021-01-18 03:35

i have a appservice on azure that is running a .net core api.

in my appsettings.json file i have a section something similar to :

\"Serilog\": {    
         


        
2条回答
  •  悲哀的现实
    2021-01-18 03:58

    you use : to nest:keys:down

    cross platform you use __ to nest__keys__down (since : are bad for envars in *nix)

    the key thing is it's not azure doing anything special... azure just sets env vars for the app from there. it's .net core config that's actually looking at the env vars and doing special things see https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/index?tabs=basicconfiguration&view=aspnetcore-3.1#hierarchical-configuration-data & https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/index?tabs=basicconfiguration&view=aspnetcore-3.1#environment-variables-configuration-provider

提交回复
热议问题