Using an array in Azure web app settings

后端 未结 2 1272
慢半拍i
慢半拍i 2020-12-14 00:15

In my ASP.NET 5 (RC1) code I have an appsetting.json that looks something like this:

{
    \"SomeSettings\": {
        \"PropA\": \"ValueA\",
        \"PropB         


        
2条回答
  •  爱一瞬间的悲伤
    2020-12-14 00:59

    Simple approach is store the JSON as string in AppSetting, and de-serialize by yourself

    var serializer = new JavaScriptSerializer();
    var settings = serializer.Deserialize(configuration.GetSection("SomeSettings"));
    

    or you will have to create your own customer configuration i believe. https://msdn.microsoft.com/en-us/library/2tw134k3.aspx

提交回复
热议问题