Reading settings from a Azure Function

前端 未结 3 1232
暗喜
暗喜 2021-02-04 01:26

I\'m new to Azure\'s function... I\'ve created a new timer function (will be fired every 30 minutes) and it has to perform a query on a URL, then push data on the buffer..

3条回答
  •  灰色年华
    2021-02-04 01:39

    You need to go to Platform Features -> Application settings and add it there.

    Add the setting under App settings.


    Reading the setting can be done by first adding this at the top:

    using System.Configuration;
    

    And then reading a setting with:

    string setting = ConfigurationManager.AppSettings["url"];
    

    Where url is your setting key. The setting variable will contain your setting value.

提交回复
热议问题