C
C#2y ago
BokoGanga

Reading file content from Azure Blob Storage

Hey devs, I have a an excel file stored on blob storage. I need to read its content directly in a service. I have access to the direct download url for the file. Any leads on how to read its content?
14 Replies
Binto86
Binto862y ago
So the question is how to read excel file?
phaseshift
phaseshift2y ago
seems like it
BokoGanga
BokoGanga2y ago
from a URL not a downloaded file in a directory is it mandatory to inject the HttpClient into the service? This is a service linked to an API controller
phaseshift
phaseshift2y ago
you cant read file data from a url
Cisien
Cisien2y ago
you'll have to download it in some form or another even if it's just to a temp folder
BokoGanga
BokoGanga2y ago
I see. That's what I needed to know. Thanks a lot.
Yawnder
Yawnder2y ago
You don't have to persist it, but you do have to download it. It can stay in a memory stream for example.
BokoGanga
BokoGanga2y ago
That's what I was trying to achieve. Download the file as stream into memory, and then get the data as byte[] without the need to download the file into the root directory.
Yawnder
Yawnder2y ago
Then do so? As they mentioned earlier, you will still have to download it.
Binto86
Binto862y ago
The excel parsing libraries won't be happy about it tho
Yawnder
Yawnder2y ago
Sure it will
BokoGanga
BokoGanga2y ago
I will look into it. As for the excel parsing libraries im using, they accept streams to parse the data. I don't know if this will be doable or not. Will see how it goes
Yawnder
Yawnder2y ago
It is doable. I've done it.
BokoGanga
BokoGanga2y ago
Perfect. Thanks a lot.