以下是我的项目结构:
ProjectX
- www (folder)
- - index.html (target file that want to access)
- MyFunc.cs (Function)
- local.settings.json
部署到 Azure Linux Function 后,我找不到找到index.html
.
我已经尝试过以下路径:
- /home/site/wwwroot/
- /home/site/wwwroot/MyFunc/
- /家/网站/
- /home/site/wwwroot/bin/
- /home/site/wwwroot/bin/runtimes
以下是我检查文件的编码:
public static async Task Run([ServiceBusTrigger(ServiceBusContext.MyQueueName, Connection = "ServiceBus")] Message msg, ILogger log)
{
// change to different paths
var testDir1 = new DirectoryInfo($@"/home/site/wwwroot/");
FindFileInfo(testDir1, log);
}
public static void FindFileInfo(DirectoryInfo dir, ILogger log)
{
FileInfo[] files = dir.GetFiles();
foreach (FileInfo file in files)
{
log.LogInformation("Check File, RootDir=" + dir.FullName + ", File: {0}", file.Name);
}
}