Skip to content

Conversation

@vincenttran-msft
Copy link
Member

@vincenttran-msft vincenttran-msft commented Oct 10, 2025

.tsp: Azure/azure-rest-api-specs#37830

  • Uses our new TypeSpec definition for the underlying generated code, which now uses a flattened client structure rather than a hierarchical client structure
  • Refactors all convenience layer clients to be compatible with the new generated code
  • As a result of the refactor, we now support SAS URL support
  • Added from_url methods to support client construction directly from URLs, as well as specifically URLs already containing SAS parameters i.e. from_blob_sas_url

@github-actions github-actions bot added the Storage Storage Service (Queues, Blobs, Files) label Oct 10, 2025
@heaths
Copy link
Member

heaths commented Oct 10, 2025

@vincenttran-msft is there a reason PRs with similar titles keep getting created and closed? Everything the PRs do you can do locally e.g., cargo test -p azure_storage_blob or cargo clippy -p azure_storage_blob. This is faster for the inner dev loop and less disruptive.

@vincenttran-msft
Copy link
Member Author

@vincenttran-msft is there a reason PRs with similar titles keep getting created and closed? Everything the PRs do you can do locally e.g., cargo test -p azure_storage_blob or cargo clippy -p azure_storage_blob. This is faster for the inner dev loop and less disruptive.

Sorry for that. I am not concerned about using these for CI pipelines or Analyze checks, these are because there have been some design decisions that we have been discussing internally on the DevEx side, and so I had both proof-of-concepts in two separate branches and we were reviewing them side by side. Having them up in draft PRs was what I thought was easiest to allow reviewers to pre-read at their leisure and also take a look separately if they weren't as concerned with what was being projected during our screenshare. I prematurely closed one of them thinking we were going with another design, but after our meeting yesterday we ended up going back in the other direction.

@heaths
Copy link
Member

heaths commented Oct 10, 2025

You can reopen PRs.

@github-actions
Copy link

github-actions bot commented Oct 17, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure_storage_blob

@vincenttran-msft
Copy link
Member Author

@LarryOsterman Hi Larry, any ideas on the test failures in azure_messaging_eventhubs_checkpointstore_blob? Here is the beginning of the relevant portion of the logs:
https://dev.azure.com/azure-sdk/public/_build/results?buildId=5472054&view=logs&j=b3705cf4-1bfd-5944-2427-bf6d701924fc&t=aeef5f29-1c5f-5421-3007-7ccba6bbfcec&l=796

The main change that would affect your codepath is that BlobContainerClient's new() constructor changed signatures from:

 pub fn new(
        endpoint: &str,
        container_name: String,
        credential: Arc<dyn TokenCredential>,
        options: Option<BlobContainerClientOptions>,
    ) -> Result<Self> {

to

pub fn new(
        endpoint: &str,
        container_name: &str,
        credential: Option<Arc<dyn TokenCredential>>,
        options: Option<BlobContainerClientOptions>,
    ) -> Result<Self> {

Namely:

  1. container_name went from owned String to &str
  2. credential is now optional to support public access

I did go ahead and update the relevant call-sites to get everything compiling nicely, but I seem to have broke the unit tests in the process 😞

Thanks!

@vincenttran-msft vincenttran-msft marked this pull request as ready for review October 21, 2025 02:34
@Copilot Copilot AI review requested due to automatic review settings October 21, 2025 02:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors Azure Storage Blob clients to use a flattened client structure based on new TypeSpec definitions. The refactor changes client construction patterns to support optional credentials (enabling SAS URL and public access scenarios) and adds from_url methods for constructing clients directly from URLs.

Key changes:

  • Updated all client constructors to accept optional credentials instead of required credentials
  • Changed string parameters to string references for container and blob names
  • Added from_url factory methods to all client types for URL-based construction
  • Replaced manual URL construction with blob_client.url() accessor throughout tests

Reviewed Changes

Copilot reviewed 28 out of 38 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
sdk/storage/azure_storage_blob/src/clients/*.rs Refactored all client types to support optional credentials and URL-based construction
sdk/storage/azure_storage_blob/tests/*.rs Updated test code to use reference parameters and .url() accessor
sdk/storage/azure_storage_blob_test/src/lib.rs Updated test helper functions for new client constructor signatures
sdk/eventhubs/azure_messaging_eventhubs_checkpointstore_blob/* Updated Event Hubs checkpoint store to use new BlobContainerClient API
eng/emitter-package.json Updated TypeSpec tooling dependencies to newer versions
Files not reviewed (1)
  • eng/emitter-package-lock.json: Language not supported

Copy link
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not done a full review because I think my one comment is going to cause enough churn already. As is, this is not what we previously discussed.

Copy link
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better, but we shouldn't panic at runtime when we can avoid it.

@vincenttran-msft vincenttran-msft marked this pull request as draft October 22, 2025 01:14
@vincenttran-msft vincenttran-msft marked this pull request as ready for review October 22, 2025 03:07
Copy link
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from my one overarching comment about idiomacy, the rest of the changes look great!

@vincenttran-msft vincenttran-msft marked this pull request as draft October 24, 2025 00:50
@vincenttran-msft vincenttran-msft marked this pull request as ready for review October 24, 2025 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants