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

Use Azure SDK to upload files to Azure Blob #3033

Merged
merged 21 commits into from Jan 8, 2024

Conversation

yacaovsnc
Copy link
Contributor

@yacaovsnc yacaovsnc commented Dec 11, 2023

This pull request changes ResultsHttpClient.cs to use Azure Storage Blobs SDK to upload logs and summaries.

This allows us to control timeout and retries independently since we were using the same http layer for both communications to results service and Azure blob storage. Now we can rely on the SDK to manage details such as headers and query params.

Using Azure specific SDK means we need to add additional logic for other blob providers down the road. This is an acceptable tradeoff.

Here are the most important changes:

Integration of Azure Storage Blobs SDK:

  • src/Sdk/Sdk.csproj: Added a package reference to the Azure Storage Blobs SDK.
  • src/Sdk/WebApi/WebApi/ResultsHttpClient.cs: Imported the Azure Storage Blobs SDK namespaces.

Refactoring of methods for uploading files to Azure Blob Storage:

  • src/Sdk/WebApi/WebApi/ResultsHttpClient.cs: Replaced the HTTP request-based file upload methods with methods that use the Azure Storage Blobs SDK. This includes changes to UploadBlockFileAsync, CreateAppendFileAsync, and UploadAppendFileAsync.
  • src/Sdk/WebApi/WebApi/ResultsHttpClient.cs: Removed constants related to Azure Blob Storage headers.

@yacaovsnc yacaovsnc requested a review from a team as a code owner December 11, 2023 22:39
Co-authored-by: Tingluo Huang <tingluohuang@github.com>
TingluoHuang
TingluoHuang previously approved these changes Jan 8, 2024
@TingluoHuang TingluoHuang merged commit ac39c4b into actions:main Jan 8, 2024
10 checks passed
@yacaovsnc yacaovsnc deleted the use_azure_sdk branch January 8, 2024 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants