我有一个 json 配置文件,我想从 Azure 函数内部读取该文件。默认情况下,我们有 localsettings.json 文件,但我还需要一个 Json 配置文件来读取我的函数代码。最好的方法是什么,到目前为止,对于我的其他项目,我可以通过下面的代码阅读,但这在 Azure 函数内部不起作用。
var builder = new ConfigurationBuilder()
.SetBasePath(Path.Combine(Root))
.AddJsonFile("DataFileConfiguration.json", optional: false);
var config = builder.Build();
var tableStorageOutput = new TableStorageConfiguration();
config.GetSection("TableStorageRule").Bind(tableStorageOutput);
最佳答案
关于c# - 如何读取 Azure Function 应用程序内的配置 json 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64778036/