I'm trying to parse a .csv file located in Azure blob storage. When I parse the .csv file from my local using File.Readlines()
, it works fine. When I pass the path of the blob and debug, I get the following message at File.Readlines()
:
Here's my code:
public IList<blabla> getFiles()
{
_rootFileDirectory = configurationService.GetString("stuff-stuff-stuff-stuff");
var path = Path.Combine(_rootFileDirectory + "File", $"{_Id}.csv");
var filePath = path.Contains("https://") ? path.Replace('\\', '/') : path;
var listOfObjects = Parser(filePath); <-----
return listOfObjects;
}
private IList<blabla> Parser(string filePath)
{
var Data = File.ReadLines(filePath); <-----
foreach...
}
The path that keeps failing is:
<add key="stuff-stuff-stuff-stuff" value="https://*******.blob.core.windows.net/******/" />
Again, when I run from my local (C:\Users\*******\Desktop\
), it works fine. I'm guessing this is because File.Readlines()
isn't able to read https paths. Can anyone confirm this and help me find a work-around with the same functionality?
Thanks in advance for helping a noob out.