{"record":{"id":"7d08c1af38b8fd0f","repo":"dotnet/runtime","slug":"missing-azure-storage-package","errorCode":null,"errorMessage":"Missing Azure Storage package.","messagePattern":"Missing Azure Storage package\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/jitutil.py","lineNumber":596,"sourceCode":"        except:\n            azure_storage_blob_import_ok = False\n\n    azure_identity_import_ok = True\n    if need_azure_identity:\n        try:\n            from azure.identity import AzureCliCredential\n        except:\n            azure_identity_import_ok = False\n\n    if not azure_storage_blob_import_ok or not azure_identity_import_ok:\n        logging.error(\"One or more required Azure Storage packages is missing.\")\n        logging.error(\"\")\n        logging.error(\"Please install:\")\n        logging.error(\"  pip install azure-storage-blob azure-identity\")\n        logging.error(\"or (Windows):\")\n        logging.error(\"  py -3 -m pip install azure-storage-blob azure-identity\")\n        logging.error(\"See also https://learn.microsoft.com/azure/storage/blobs/storage-quickstart-blobs-python\")\n        raise RuntimeError(\"Missing Azure Storage package.\")\n\n    # The Azure packages spam all kinds of output to the logging channels.\n    # Restrict this to only ERROR and CRITICAL.\n    for name in logging.Logger.manager.loggerDict.keys():\n        if 'azure' in name:\n            logging.getLogger(name).setLevel(logging.ERROR)\n\n\ndef report_azure_error():\n    \"\"\" Report an Azure error\n    \"\"\"\n    logging.error(\"A problem occurred accessing Azure. Are you properly authenticated using the Azure CLI?\")\n    logging.error(\"Install the Azure CLI from https://learn.microsoft.com/cli/azure/install-azure-cli.\")\n    logging.error(\"Then log in to Azure using `az login`.\")\n\n\ndef download_with_azure(uri, target_location, fail_if_not_found=True):\n    \"\"\" Do an URI download using Azure blob storage API. Compared to urlretrieve,","sourceCodeStart":578,"sourceCodeEnd":614,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/jitutil.py#L578-L614","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Install both: `pip install azure-storage-blob azure-identity`.","Ensure the install targets the interpreter running the script (`python -m pip install ...`).","Verify with `python -c \"import azure.storage.blob, azure.identity\"` before re-running."],"exampleFix":"// before\npython superpmi.py asmdiffs ...   # triggers authenticated download -> 'Missing Azure Storage package.'\n// after\npython -m pip install azure-storage-blob azure-identity\npython superpmi.py asmdiffs ...","handlingStrategy":"validation","validationCode":"import importlib.util\nmissing = [m for m in (\"azure.storage.blob\", \"azure.identity\") if importlib.util.find_spec(m) is None]\nif missing:\n    raise SystemExit(\"Missing packages: \" + \", \".join(missing) + \"; pip install azure-storage-blob azure-identity\")","typeGuard":null,"tryCatchPattern":"try:\n    jitutil.require_azure_storage_libraries()\nexcept RuntimeError:\n    logging.error(\"Azure SDK missing; install azure-storage-blob azure-identity before retrying authenticated downloads\")\n    # fall back to anonymous urllib path or abort","preventionTips":["Install the Azure SDK in every CI image that runs superpmi/jitrollingbuild.","Set authenticate_using_azure=False when you only need anonymous public blobs, to avoid the import gate."],"tags":["jitutil","azure","dependency","superpmi","python"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}