{"record":{"id":"a7acfd4fc7800dcf","repo":"apache/beam","slug":"azure-dependencies-are-not-installed-unable-to-run","errorCode":null,"errorMessage":"Azure dependencies are not installed. Unable to run.","messagePattern":"Azure dependencies are not installed\\. Unable to run\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"sdks/python/apache_beam/io/azure/blobstorageio.py","lineNumber":124,"sourceCode":"class BlobStorageIO(object):\n  \"\"\"Azure Blob Storage I/O client.\"\"\"\n  def __init__(self, client=None, pipeline_options=None):\n    if client is None:\n      azure_options = pipeline_options.view_as(AzureOptions)\n      connect_str = azure_options.azure_connection_string or \\\n                    os.getenv('AZURE_STORAGE_CONNECTION_STRING')\n      if connect_str:\n        self.client = BlobServiceClient.from_connection_string(\n            conn_str=connect_str)\n      else:\n        credential = auth.get_service_credentials(pipeline_options)\n        self.client = BlobServiceClient(\n            account_url=azure_options.blob_service_endpoint,\n            credential=credential)\n    else:\n      self.client = client\n    if not AZURE_DEPS_INSTALLED:\n      raise RuntimeError('Azure dependencies are not installed. Unable to run.')\n\n  def open(\n      self,\n      filename,\n      mode='r',\n      read_buffer_size=DEFAULT_READ_BUFFER_SIZE,\n      mime_type='application/octet-stream'):\n    \"\"\"Open an Azure Blob Storage file path for reading or writing.\n\n    Args:\n      filename (str): Azure Blob Storage file path in the form\n                      ``azfs://<storage-account>/<container>/<path>``.\n      mode (str): ``'r'`` for reading or ``'w'`` for writing.\n      read_buffer_size (int): Buffer size to use during read operations.\n      mime_type (str): Mime type to set for write operations.\n\n    Returns:\n      Azure Blob Storage file object.","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/io/azure/blobstorageio.py#L106-L142","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Install the Azure extra: pip install 'apache-beam[azure]' (or pip install azure-storage-blob azure-azure-identity as required by your Beam version)","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","Rebuild Docker images / requirements files to include the Azure extra for all workers","If version conflicts occur, align azure-storage-blob with the version pinned by your apache-beam release"],"exampleFix":"// before\npip install apache-beam\n// after\npip install 'apache-beam[azure]'","handlingStrategy":"validation","validationCode":"from apache_beam.io.azure import blobstorageio\nif not blobstorageio.AZURE_DEPS_INSTALLED:\n    raise RuntimeError(\"Install Azure deps: pip install 'apache-beam[azure]'\")","typeGuard":"def azure_available():\n    try:\n        import azure.storage.blob  # noqa: F401\n        return True\n    except ImportError:\n        return False","tryCatchPattern":"try:\n    io = blobstorageio.BlobStorageIO(azure_options)\nexcept RuntimeError as e:\n    if 'Azure dependencies' in str(e):\n        raise SystemExit(\"Azure SDK missing; install apache-beam[azure] in this environment\")\n    raise","preventionTips":["Install apache-beam with the [azure] extra in all environments (dev, CI, workers, Docker images)","Assert AZURE_DEPS_INSTALLED at pipeline startup with a clear fail-fast message","Pin azure-storage-blob to the version your apache-beam release expects","Keep requirements/container images for Azure jobs separate from GCS/S3-only jobs to avoid dependency pruning"],"tags":["python","apache-beam","azure-blob-storage","missing-dependency","environment-setup"],"backgroundTag":"missing-dependency","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}