Im trying to read a file that I've created which contains some URL's for my Azure Function app. I am using the File object to read it and eventually parse it to an array, but it cannot seem to find the file.
using (StreamReader r = File.OpenText(path))
{
Console.WriteLine(r.ToString());
}
Error occurs when its trying to read the Path which I have passed through from the run function as seen below.
var path = System.IO.Path.Combine(executionContext.FunctionDirectory, "url.json");
getURLs(path);
I was told to use the ExecutionContext which I have applied now, but I still am not able to see the file that i've created. I am trying to run the function app locally. I have checked the bin/debug files and noticed that the URL.json file was not being copied over to the output files so I've also changed the property to copy always.
What I have noticed is that the file is being deleted when I am running the application.
When manually building the application it does show that its being copied over from the project folder but when run it gets removed. Does anyone encountered this issue and know what I should do to fix this?