Load Connection String from Config File in Azure Functions

前端 未结 6 1736
伪装坚强ぢ
伪装坚强ぢ 2020-12-20 13:09

In my Azure Function I am using a Library which establishes a connection to an SQL server via the ConnectionString from the ConfigurationManager like this:

v         


        
6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-20 13:56

    I had this same issue and am using .net standard (as opposed to core). I added my settings to the Application Settings section of my Azure function (in Azure Portal):-

    I then downloaded a zip of the function:-

    Included in this download is a copy of local.settings.json that includes my app settings in the correct json format. I then access them via ConfigurationManager.Appsettings["mysetting"]

提交回复
热议问题