Azure Functions how to add application settings to bindings

后端 未结 2 2051
猫巷女王i
猫巷女王i 2021-02-14 01:35

I\'m trying to add some custom binding using my app settings for my Azure Function. I need to receive only string a string from my settings.

I would like to get

相关标签:
2条回答
  • 2021-02-14 02:11

    I already found the solution. Just add:

    using System.Configuration;
    

    and add this line to code with the key ("simpleValue") value:

    ConfigurationManager.AppSettings["simpleValue"]
    
    0 讨论(0)
  • 2021-02-14 02:14

    App Settings configurations can be referred in binding json as %MY_CUSTOM_CONFIG% - enclosed within percent symbols.

    Note that the connection property of triggers and bindings is a special case and automatically resolves values as app settings, without percent signs. https://docs.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings

    0 讨论(0)
提交回复
热议问题