{Spring} Remove DATA_COSMOS_TABLE and DATA_STORAGE references#9085
{Spring} Remove DATA_COSMOS_TABLE and DATA_STORAGE references#9085calvinhzy merged 7 commits intoAzure:mainfrom
Conversation
…able to test as deprecated
|
Hi @calvinhzy, |
️✔️Azure CLI Extensions Breaking Change Test
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
CodeGen Tools Feedback CollectionThank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey |
|
Hi @calvinhzy
|
…ure Spring Apps service instance. For more details, please refer to the retirement announcement https://aka.ms/asaretirement.
There was a problem hiding this comment.
Pull Request Overview
This PR updates the Azure Spring extension to remove dependencies on deprecated DATA_COSMOS_TABLE and DATA_STORAGE resource types, migrating to newer Azure Storage SDK implementations. The changes modernize the storage client usage patterns throughout the codebase.
- Migrates from legacy
AppendBlobServiceandFileServiceto modernBlobClientandShareFileClientAPIs - Updates test decorators to use
@live_only()for proper test execution - Removes deprecated storage SDK references and helper utilities
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/spring/setup.py |
Version bump to 1.28.2 |
src/spring/HISTORY.md |
Release notes documenting the storage reference removal |
src/spring/azext_spring/_stream_utils.py |
Major refactor replacing legacy blob service with modern BlobClient API |
src/spring/azext_spring/_deployment_uploadable_factory.py |
Updates file upload to use ShareFileClient instead of FileService |
src/spring/azext_spring/_deployment_deployable_factory.py |
Adds cmd parameter to stream_logs call |
src/spring/azext_spring/custom.py |
Adds cmd parameter to stream_logs call |
| Test files | Adds @live_only() decorators and time.sleep() calls for test reliability |
| Recording file | Updates API version from 2022-09-01 to 2024-11-01 |
| logger_level_func): | ||
|
|
There was a problem hiding this comment.
The function signature has changed but the docstring and parameter documentation are missing. The removal of container_name and blob_name parameters should be documented, and the new blob_service parameter (now a BlobClient) should be clearly documented.
| logger_level_func): | |
| logger_level_func): | |
| """ | |
| Streams logs from an Azure Blob storage using the provided BlobClient. | |
| Note: The function signature has changed. The parameters `container_name` and `blob_name` have been removed. | |
| Instead, the `blob_service` parameter should be provided as an instance of BlobClient. | |
| Args: | |
| no_format (bool): If True, disables color formatting of logs. | |
| byte_size (int): The chunk size in bytes to read from the blob. | |
| timeout_in_seconds (int): The maximum time in seconds to stream logs before timing out. | |
| blob_service (BlobClient): The Azure BlobClient instance pointing to the log blob. | |
| raise_error_on_failure (bool): If True, raises an error when log streaming fails. | |
| logger_level_func (function): The logger function to use for warnings and errors. | |
| """ |
| downloader = blob_service.download_blob(offset=start, length=byte_size, max_concurrency=1) | ||
| downloader.readinto(stream) |
There was a problem hiding this comment.
The readinto method may not behave as expected with BytesIO streams. The modern BlobClient API typically returns a StorageStreamDownloader that should use readall() or iterate over chunks. Consider using stream.write(downloader.readall()) instead.
| downloader = blob_service.download_blob(offset=start, length=byte_size, max_concurrency=1) | |
| downloader.readinto(stream) | |
| stream.write(downloader.readall()) |
|
Please fix CI issues |
|
[Release] Update index.json for extension [ spring-1.28.2 ] : https://dev.azure.com/msazure/One/_build/results?buildId=135648816&view=results |
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
As main repo has removed all DATA_COSMOS_TABLE and DATA_STORAGE usage, removing it here as well. Not fixing style issues as the module is planned to be deprecated soon.
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.