Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQ] Storage: Better Stream support #13392

Closed
yahorsi opened this issue Jul 10, 2020 · 4 comments
Closed

[FEATURE REQ] Storage: Better Stream support #13392

yahorsi opened this issue Jul 10, 2020 · 4 comments
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request This issue requires a new behavior in the product in order be resolved. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)

Comments

@yahorsi
Copy link

yahorsi commented Jul 10, 2020

Hi Guys,

Using latest SDK: 12.4.4

We're migrating to the Azure and was a bit surprised the SDK does not have "full" Stream support.
Imagine we have following code that writes stream:

            using (var fileStream = fileProvider.CreateOutputStream(fullFilePath))
            using (var outputStream = new ZipOutputStream(fileStream))
            using (var writer = new StreamWriter(outputStream))
            {
                outputStream.PutNextEntry(new ZipEntry($"{reportTitle}.{FileExtensionConstant.CSV}"));
                new CommissionHistoryCsvExporter().ExportToCsv(selectQuery, queryParams, writer);
            }

In the code above, CreateOutputStream, creates file based stream.
With current API we cannot migrate to the Azure blob storage without significant code changes, currently to upload the blow there is only one method Upload that accepts stream that must "pre exists". In other words, you have to have a stream already, and in order to get one you must create it on the memory or file. Creating it on memory is not acceptable for us as files might be big, creating on the file system in not acceptable because of the load and space limitations.

Suggestions:
Add API to expose upload/download stream explicitly.
Like:

  1. Stream .GetUploadStream()
  2. Stream .GetDownloadStream()

This will fully enable Stream.CopyTo() functionality and will make integration with existing code way simpler.

Seems similar issues:
#9607

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jul 10, 2020
@jsquire jsquire changed the title [FEATURE REQ] Better Stream support [FEATURE REQ] Storage: Better Stream support Jul 11, 2020
@jsquire jsquire added Client This issue points to a problem in the data-plane of the library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files) labels Jul 11, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jul 11, 2020
@ghost
Copy link

ghost commented Jul 11, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

@amnguye amnguye added feature-request This issue requires a new behavior in the product in order be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jul 13, 2020
@amnguye
Copy link
Member

amnguye commented Jul 13, 2020

@seanmcc-msft is this a duplicate?

@yahorsi
Copy link
Author

yahorsi commented Jul 13, 2020

Just FYI, in the V11 there is OpenWrite method that does exactly what we need.

@seanmcc-msft
Copy link
Member

Duplicate of #9607.

We are actively working on this issue: #12400, #13344.

openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-net that referenced this issue Mar 16, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request This issue requires a new behavior in the product in order be resolved. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

4 participants