Skip to content

Conversation

@weirongw23-msft
Copy link
Member

No description provided.

@github-actions github-actions bot added the Storage Storage Service (Queues, Blobs, Files) label Oct 21, 2025
@weirongw23-msft weirongw23-msft marked this pull request as ready for review October 21, 2025 19:25
Copilot AI review requested due to automatic review settings October 21, 2025 19:25
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 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

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':
Copy link

Copilot AI Oct 21, 2025

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.

Suggested change
if conn_settings.get('USEDEVELOPMENTSTORAGE') == 'true':
if conn_settings.get('USEDEVELOPMENTSTORAGE', '').lower() == 'true':

Copilot uses AI. Check for mistakes.
Copy link
Member Author

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?

Copy link
Member Author

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

@weirongw23-msft
Copy link
Member Author

The current failures are due to a circular import error. It is likely the case that we cannot put these constants in constants.py and then use them in parser.py. Will try refactoring out the constants...

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.

1 participant