-
Couldn't load subscription status.
- Fork 3.2k
[Storage] Added Support for UseDevelopmentStorage=true; for Connection String Client Constructors
#43565
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
base: main
Are you sure you want to change the base?
[Storage] Added Support for UseDevelopmentStorage=true; for Connection String Client Constructors
#43565
Conversation
There was a problem hiding this 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 adds support for the UseDevelopmentStorage=true; connection string format across Azure Storage client constructors, enabling developers to easily connect to local development storage emulators (like Azurite). The implementation follows the Azure Storage emulator's standard configuration by automatically configuring the appropriate endpoints, credentials, and protocol settings when this connection string format is detected.
Key Changes:
- Added connection string parsing logic to detect and handle
UseDevelopmentStorage=true - Implemented hardcoded development storage credentials and endpoints matching Azure Storage Emulator defaults
- Added comprehensive test coverage for the new development storage connection string feature
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py | Implements _parse_development_storage() function with emulator defaults and adds detection logic in parse_connection_str() |
| sdk/storage/azure-storage-blob/tests/test_blob_client.py | Adds test case validating development storage connection string parsing and client initialization |
sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py
Outdated
Show resolved
Hide resolved
| if any(len(tup) != 2 for tup in conn_settings_list): | ||
| raise ValueError("Connection string is either blank or malformed.") | ||
| conn_settings = dict((key.upper(), val) for key, val in conn_settings_list) | ||
| if conn_settings.get('USEDEVELOPMENTSTORAGE') == 'true': |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comparison should be case-insensitive for the value. Consider using .lower() == 'true' to handle connection strings like UseDevelopmentStorage=True; or UseDevelopmentStorage=TRUE; which may be valid variations.
| if conn_settings.get('USEDEVELOPMENTSTORAGE') == 'true': | |
| if conn_settings.get('USEDEVELOPMENTSTORAGE', '').lower() == 'true': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we support case insensitivity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 423 already uppercase all the keys, so we don't have to worry about case sensitivity again
|
The current failures are due to a circular import error. It is likely the case that we cannot put these constants in |
No description provided.