Skip to content

Fall back to AZURE_STORAGE_CONNECTION_STRING when no Azure credentials are configured - #55

Merged
sambles merged 1 commit into
mainfrom
fix/azure-env-connection-string
Nov 19, 2026
Merged

sambles merged 1 commit into
mainfrom
fix/azure-env-connection-string

Conversation

@sambles

@sambles sambles commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem

When an AzureABFSStorage config has no connection_string and no account_name (for example a model_storage.json or lookup keys_data_storage that relies on AZURE_STORAGE_CONNECTION_STRING), the connection_string property builds:

DefaultEndpointsProtocol=https;AccountName=None;AccountKey=None

adlfs only reads AZURE_STORAGE_CONNECTION_STRING when connection_string is empty. Because this string isn't empty, the env var is ignored and requests go to public Azure for an account named None, failing with OutOfRangeInput.

Found while enabling the PiWindAzure test in OasisModels against Azurite.

Fix

  • connection_string returns None when neither connection_string nor account_name is set, so adlfs falls back to the AZURE_STORAGE_* env vars. Configs with credentials work the same as before.
  • get_storage_url leaves out the connection_string query parameter when there isn't one, instead of encoding None. split_azure_url already 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.py pass locally against the docker-compose Azurite with azure-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 from requirements.txt (API 2025-05-05, which Azurite supports), so CI isn't affected.

🤖 Generated with Claude Code

…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>
@sambles
sambles merged commit a366cdb into main Nov 19, 2026
4 checks passed
@sambles
sambles deleted the fix/azure-env-connection-string branch November 19, 2026 16:21
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant