I built an ASP.NET Core api application it is deployed to Azure web api app. In the code, I try at some point to read the contents of a file in content root, interpolating certain place holders for their actual values.
Now on my local system this works just fine cause it is able to get the exact file path of the file but in the cloud, I get an exception with the following message:
Could not find a part of the path...
I get the full file path like so:
Path.Combine(hostingEnvironment.ContentRootPath, "containing directory\filename")
But this fails in the cloud. Are there extras I should know about deploying this or what am I doing wrong with respect to understanding directory structuring in cloud deployment?
N.B I could store this file in an Azure file storage container but I feel it will be too much hassle to read it plus the cost seeing this file will be read quite often.