dotnet/runtime · error · RuntimeError

Missing Azure Storage package.

Error message

Missing Azure Storage package.

What it means

Raised by require_azure_storage_libraries() in jitutil.py when the lazy import of azure.storage.blob (BlobServiceClient/BlobClient/ContainerClient) or azure.identity (AzureCliCredential) fails. It is the shared guard used by superpmi.py and other scripts that download/upload via authenticated Azure blob APIs.

Solutions

  1. Install both: `pip install azure-storage-blob azure-identity`.
  2. Ensure the install targets the interpreter running the script (`python -m pip install ...`).
  3. Verify with `python -c "import azure.storage.blob, azure.identity"` before re-running.

Example fix

// before
python superpmi.py asmdiffs ...   # triggers authenticated download -> 'Missing Azure Storage package.'
// after
python -m pip install azure-storage-blob azure-identity
python superpmi.py asmdiffs ...
Defensive patterns

Strategy: validation

Validate before calling

import importlib.util
missing = [m for m in ("azure.storage.blob", "azure.identity") if importlib.util.find_spec(m) is None]
if missing:
    raise SystemExit("Missing packages: " + ", ".join(missing) + "; pip install azure-storage-blob azure-identity")

Try / catch

try:
    jitutil.require_azure_storage_libraries()
except RuntimeError:
    logging.error("Azure SDK missing; install azure-storage-blob azure-identity before retrying authenticated downloads")
    # fall back to anonymous urllib path or abort

Prevention

When it happens

Trigger: Any code path that triggers an authenticated Azure download/upload (authenticate_using_azure True) without azure-storage-blob and/or azure-identity installed in the active interpreter.

Common situations: Fresh environment without the Azure SDK; packages installed in a different venv; CI container missing the pip packages; partial install (only one of the two packages present).

Related errors


AI-assisted analysis of dotnet/runtime@60108ba66e (2026-08-10). Data as JSON: /api/errors/7d08c1af38b8fd0f. Report an issue: GitHub.

Appendix: source

Thrown at src/coreclr/scripts/jitutil.py:596

        except:
            azure_storage_blob_import_ok = False

    azure_identity_import_ok = True
    if need_azure_identity:
        try:
            from azure.identity import AzureCliCredential
        except:
            azure_identity_import_ok = False

    if not azure_storage_blob_import_ok or not azure_identity_import_ok:
        logging.error("One or more required Azure Storage packages is missing.")
        logging.error("")
        logging.error("Please install:")
        logging.error("  pip install azure-storage-blob azure-identity")
        logging.error("or (Windows):")
        logging.error("  py -3 -m pip install azure-storage-blob azure-identity")
        logging.error("See also https://learn.microsoft.com/azure/storage/blobs/storage-quickstart-blobs-python")
        raise RuntimeError("Missing Azure Storage package.")

    # The Azure packages spam all kinds of output to the logging channels.
    # Restrict this to only ERROR and CRITICAL.
    for name in logging.Logger.manager.loggerDict.keys():
        if 'azure' in name:
            logging.getLogger(name).setLevel(logging.ERROR)


def report_azure_error():
    """ Report an Azure error
    """
    logging.error("A problem occurred accessing Azure. Are you properly authenticated using the Azure CLI?")
    logging.error("Install the Azure CLI from https://learn.microsoft.com/cli/azure/install-azure-cli.")
    logging.error("Then log in to Azure using `az login`.")


def download_with_azure(uri, target_location, fail_if_not_found=True):
    """ Do an URI download using Azure blob storage API. Compared to urlretrieve,

View on GitHub (pinned to 60108ba66e)