Repository navigation
Fall back to AZURE_STORAGE_CONNECTION_STRING when no Azure credentials are configured - #55
Merged
Merged
Conversation
…s are configured AzureABFSStorage.connection_string built "AccountName=None;AccountKey=None" when neither connection_string nor account_name was set. That non-empty string stopped adlfs from falling back to AZURE_STORAGE_CONNECTION_STRING, so requests went to public Azure for an account named "None". Return None in that case, and leave connection_string out of storage URLs when there isn't one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Open
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.
Problem
When an
AzureABFSStorageconfig has noconnection_stringand noaccount_name(for example amodel_storage.jsonor lookupkeys_data_storagethat relies onAZURE_STORAGE_CONNECTION_STRING), theconnection_stringproperty builds:adlfs only reads
AZURE_STORAGE_CONNECTION_STRINGwhenconnection_stringis empty. Because this string isn't empty, the env var is ignored and requests go to public Azure for an account namedNone, failing withOutOfRangeInput.Found while enabling the PiWindAzure test in OasisModels against Azurite.
Fix
connection_stringreturnsNonewhen neitherconnection_stringnoraccount_nameis set, so adlfs falls back to theAZURE_STORAGE_*env vars. Configs with credentials work the same as before.get_storage_urlleaves out theconnection_stringquery parameter when there isn't one, instead of encodingNone.split_azure_urlalready treats a missing parameter as "use the env var".Tests
Added to
tests/filestorage/test_azure.py:test_no_credentials___connection_string_is_none(unit, passes locally)test_no_credentials___storage_url_has_no_connection_string(unit, passes locally)test_no_credentials___env_connection_string_is_used: writes and reads a file against Azurite using only the env var.All 6 tests in
test_azure.pypass locally against the docker-compose Azurite withazure-storage-blob==12.27.0. Newer SDKs (12.28.0+) use API versions that the current Azurite (3.35.0) rejects. CI installs the 12.25.1 pin fromrequirements.txt(API2025-05-05, which Azurite supports), so CI isn't affected.🤖 Generated with Claude Code