Storage - STG102 IPv6#48468
Draft
browndav-msft wants to merge 7 commits intoAzure:feature/storage/stg102basefrom
Draft
Storage - STG102 IPv6#48468browndav-msft wants to merge 7 commits intoAzure:feature/storage/stg102basefrom
browndav-msft wants to merge 7 commits intoAzure:feature/storage/stg102basefrom
Conversation
Member
browndav-msft
commented
Mar 19, 2026
- Refactor duplicate code in BuilderHelpers and BlobUrlParts so that they use storageImplUtils.getAccountNameFromHost()
- Left original getAccountName with single param, created overload with ServiceSubDomain
- Created static values for URI_SUBDOMAINS in common Constants class
browndav-msft
commented
Mar 19, 2026
...e-storage-common/src/main/java/com/azure/storage/common/implementation/StorageImplUtils.java
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors storage endpoint parsing to centralize account-name extraction in StorageImplUtils, including support for suffix variants like -secondary, -dualstack, and -ipv6. It also introduces shared constants for service subdomains and adds/updates tests to validate the new parsing behavior.
Changes:
- Replaced duplicated “account name from host” parsing in Queue and File Share builders and in
BlobUrlPartswithStorageImplUtils.getAccountNameFromHost(...). - Added
StorageImplUtils.getAccountName(URL, serviceSubDomain)overload plus a newgetAccountNameFromHost(host, serviceSubDomain)helper that strips known endpoint suffixes. - Added
Constants.<Service>.URI_SUBDOMAINconstants and new/updated tests for the suffix parsing behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/storage/azure-storage-queue/.../BuilderHelper.java | Uses StorageImplUtils.getAccountNameFromHost for queue endpoint parsing. |
| sdk/storage/azure-storage-file-share/.../BuilderHelper.java | Uses StorageImplUtils.getAccountNameFromHost for file endpoint parsing and account-name extraction. |
| sdk/storage/azure-storage-common/.../StorageImplUtilsTests.java | Adds parameterized tests to validate service-subdomain-based parsing and suffix stripping. |
| sdk/storage/azure-storage-common/.../StorageImplUtils.java | Adds overload/helper to extract account name from host and strip known suffixes. |
| sdk/storage/azure-storage-common/.../Constants.java | Adds shared service subdomain constants (Constants.Blob/File/Queue/Table/Dfs.URI_SUBDOMAIN). |
| sdk/storage/azure-storage-blob/src/test/java/BlobUrlPartsTests.java | Adds a new test validating BlobUrlParts.parse() behavior for suffix variants. |
sdk/storage/azure-storage-blob/src/test/java/BlobUrlPartsTests.java
Outdated
Show resolved
Hide resolved
...ge/azure-storage-common/src/main/java/com/azure/storage/common/implementation/Constants.java
Outdated
Show resolved
Hide resolved
...e-storage-common/src/main/java/com/azure/storage/common/implementation/StorageImplUtils.java
Outdated
Show resolved
Hide resolved
...e-storage-common/src/main/java/com/azure/storage/common/implementation/StorageImplUtils.java
Show resolved
Hide resolved
...e-storage-common/src/main/java/com/azure/storage/common/implementation/StorageImplUtils.java
Show resolved
Hide resolved
browndav-msft
commented
Mar 20, 2026
Member
Author
There was a problem hiding this comment.
This is used by both Blob and Datalake. Added the IllegalException at the end, but could remove if you think we should.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.