如何获取对函数启动类中的ExecutionContext.FunctionAppDirectory的访问权限,以便我可以正确设置我的Configuration。请查看以下启动代码:
[assembly: WebJobsStartup(typeof(FuncStartup))]
namespace Function.Test
{
public class FuncStartup : IWebJobsStartup
{
public void Configure(IWebJobsBuilder builder)
{
var config = new ConfigurationBuilder()
.SetBasePath(“”/* How to get the Context here. I cann’t DI it
as it requires default constructor*/)
.AddJsonFile(“local.settings.json”, true, reloadOnChange: true)
.AddEnvironmentVariables()
.Build();
}
}
}
Run Code Online (Sandbox Code Playgroud) azure azure-functions azure-functions-runtime azure-functions-core-tools