Skip to content

[Storage] Make metadata a parameter for set_metadata API, StorageServiceProperties renamed to BlobServiceProperties#2919

Merged
vincenttran-msft merged 4 commits intoAzure:mainfrom
vincenttran-msft:vincenttran/tsp_fixup_and_apis
Aug 20, 2025
Merged

[Storage] Make metadata a parameter for set_metadata API, StorageServiceProperties renamed to BlobServiceProperties#2919
vincenttran-msft merged 4 commits intoAzure:mainfrom
vincenttran-msft:vincenttran/tsp_fixup_and_apis

Conversation

@vincenttran-msft
Copy link
Member

@github-actions github-actions bot added the Storage Storage Service (Queues, Blobs, Files) label Aug 19, 2025
@github-actions
Copy link

github-actions bot commented Aug 20, 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

test_set_service_properties is failing for the following:

Error: Error { context: Custom(Custom { kind: HttpResponse { status: BadRequest, error_code: Some("InvalidXmlDocument") }, error: HttpError { status: BadRequest, details: ErrorDetails { code: Some("InvalidXmlDocument"), message: None }, body: InvaalidXmlDocumentXML specified is not syntactically valid.
RequestId:
Time:2025-08-20T00:14:32.6239424Z140Error parsing Xml content: Element 'StorageServiceProperties' was not found. Line 1, position 40., .. } }) }
test test_set_service_properties ... FAILED

This is because we renamed StorageServiceProperties to BlobServiceProperties, yet the XML that is sent along with the request coincides with the model name:

<?xml version="1.0" encoding="utf-8"?>
<BlobServiceProperties>
	<DefaultServiceVersion>2022-11-02</DefaultServiceVersion>
</BlobServiceProperties>

@jhendrixMSFT Is there any way currently to augment what is emitted for this TryFrom implementation?

impl TryFrom<BlobServiceProperties> for RequestContent<BlobServiceProperties, XmlFormat> {
    type Error = azure_core::Error;
    fn try_from(value: BlobServiceProperties) -> Result<Self> {
        // RequestContent::try_from(to_xml(&value)?)
        // Change to explicitly setting the root tag expected by the service, StorageServiceProperties
        RequestContent::try_from(to_xml_with_root("StorageServiceProperties", &value)?)
    }
}

@jhendrixMSFT
Copy link
Member

You need to use the Xml.name decorator to preserve the correct XML element name.

@vincenttran-msft vincenttran-msft marked this pull request as ready for review August 20, 2025 20:11
Copilot AI review requested due to automatic review settings August 20, 2025 20:11
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 pull request updates the Azure Storage Blob SDK to align with API specification changes, renaming StorageServiceProperties to BlobServiceProperties and modifying the set_metadata API to require metadata as a parameter instead of an optional field.

Key changes:

  • Renamed StorageServiceProperties to BlobServiceProperties throughout the codebase
  • Updated set_metadata method signature to require metadata as a parameter
  • Updated TSP specification commit reference

Reviewed Changes

Copilot reviewed 7 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tsp-location.yaml Updates commit hash reference for API specification
blob_service_client.rs (tests) Updates test code to use BlobServiceProperties instead of StorageServiceProperties
blob_container_client.rs (tests) Updates test calls to use new set_metadata API signature
models/mod.rs Updates public exports to rename type and remove unused import
block_blob_client.rs Removes unused StorageServiceProperties import
blob_service_client.rs Updates type references in public API methods
blob_container_client.rs Updates set_metadata method signature to require metadata parameter

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.

If the method and/or type shipped in the previous beta, don't forget to update the CHANGELOG.md file.

@vincenttran-msft vincenttran-msft enabled auto-merge (squash) August 20, 2025 21:04
@vincenttran-msft vincenttran-msft merged commit 9ae2ee5 into Azure:main Aug 20, 2025
17 checks passed
@vincenttran-msft vincenttran-msft deleted the vincenttran/tsp_fixup_and_apis branch August 20, 2025 21:15
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.

5 participants