apache/beam · critical · RuntimeError

Azure dependencies are not installed. Unable to run.

Error message

Azure dependencies are not installed. Unable to run.

What it means

BlobStorageIO.__init__() checks the module-level AZURE_DEPS_INSTALLED flag, which is set at import time based on whether azure-storage-blob (and related packages) are importable. If they are absent it raises RuntimeError('Azure dependencies are not installed. Unable to run.'), because the class cannot function without the Azure SDK.

Source

Thrown at sdks/python/apache_beam/io/azure/blobstorageio.py:124

class BlobStorageIO(object):
  """Azure Blob Storage I/O client."""
  def __init__(self, client=None, pipeline_options=None):
    if client is None:
      azure_options = pipeline_options.view_as(AzureOptions)
      connect_str = azure_options.azure_connection_string or \
                    os.getenv('AZURE_STORAGE_CONNECTION_STRING')
      if connect_str:
        self.client = BlobServiceClient.from_connection_string(
            conn_str=connect_str)
      else:
        credential = auth.get_service_credentials(pipeline_options)
        self.client = BlobServiceClient(
            account_url=azure_options.blob_service_endpoint,
            credential=credential)
    else:
      self.client = client
    if not AZURE_DEPS_INSTALLED:
      raise RuntimeError('Azure dependencies are not installed. Unable to run.')

  def open(
      self,
      filename,
      mode='r',
      read_buffer_size=DEFAULT_READ_BUFFER_SIZE,
      mime_type='application/octet-stream'):
    """Open an Azure Blob Storage file path for reading or writing.

    Args:
      filename (str): Azure Blob Storage file path in the form
                      ``azfs://<storage-account>/<container>/<path>``.
      mode (str): ``'r'`` for reading or ``'w'`` for writing.
      read_buffer_size (int): Buffer size to use during read operations.
      mime_type (str): Mime type to set for write operations.

    Returns:
      Azure Blob Storage file object.

View on GitHub (pinned to 12126d8942)

Solutions

  1. Install the Azure extra: pip install 'apache-beam[azure]' (or pip install azure-storage-blob azure-azure-identity as required by your Beam version)
  2. Verify with python -c "from apache_beam.io.azure import blobstorageio; print(blobstorageio.AZURE_DEPS_INSTALLED)" that the flag is True in the target environment
  3. Rebuild Docker images / requirements files to include the Azure extra for all workers
  4. If version conflicts occur, align azure-storage-blob with the version pinned by your apache-beam release

Example fix

// before
pip install apache-beam
// after
pip install 'apache-beam[azure]'
Defensive patterns

Strategy: validation

Validate before calling

from apache_beam.io.azure import blobstorageio
if not blobstorageio.AZURE_DEPS_INSTALLED:
    raise RuntimeError("Install Azure deps: pip install 'apache-beam[azure]'")

Type guard

def azure_available():
    try:
        import azure.storage.blob  # noqa: F401
        return True
    except ImportError:
        return False

Try / catch

try:
    io = blobstorageio.BlobStorageIO(azure_options)
except RuntimeError as e:
    if 'Azure dependencies' in str(e):
        raise SystemExit("Azure SDK missing; install apache-beam[azure] in this environment")
    raise

Prevention

When it happens

Trigger: Instantiating BlobStorageIO (directly or via BlobStorageFileSystem operations like open/exists/delete) in an environment where apache-beam was installed without the gcp/azure extras and azure-storage-blob, azure-identity, etc. are not installed.

Common situations: Installing plain `apache-beam` instead of `apache-beam[azure]`; running in slim Docker images or Airflow workers without the Azure extra; CI environments where dependencies were pruned; version drift after upgrading apache-beam that requires newer azure-storage-blob versions.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/a7acfd4fc7800dcf. Report an issue: GitHub.