Azure Blob flow back directly from WCF

I want to return a stream from Azure Blob storage directly to the browser through WCF. Mostly I have a WCF REST service, and I'm looking for users to upload files through the service while the files are stored in Azure Blob storage.

In this question

Return Azure BLOB from WCF service as a stream - do I need to close it?

it does what I like, but first uploads the whole file to a new stream, is there a way to pass the blob stream as a returned stream from WCF, so does WCF act more like a proxy for a stream?

My problem is with large files (> 10 MB), I really do not want to download the entire stream from Azure storage before I can start returning it to the user.

The reason I do this is because I do some security checks for my user before I allow access to a file stored in Azure Blob storage, as well as some files up to 1 GB in size.

+4
source share
1 answer

I did something similar when WCF was used to authorize the client (and the blob check still exists, etc.). If everything was in order, the WCF service returned a URL with a shared access signature - this allowed the client to access the stream directly from the repository. Saving transaction costs, pulling blob into the wcf role, and then passing from there.

Is this possible for you?

+5
source

Source: https://habr.com/ru/post/1383204/


All Articles