{"record":{"id":"0a26ec1bcc2cf8b8","repo":"dotnet/runtime","slug":"missing-azure-storage-or-identity-packages","errorCode":null,"errorMessage":"Missing azure storage or identity packages.","messagePattern":"Missing azure storage or identity packages\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/jitrollingbuild.py","lineNumber":467,"sourceCode":"                logging.warning(\"Couldn't find any JIT changes! Just using the argument git_hash\")\n            else:\n                jit_git_hash = change_list_hashes[0]\n                logging.info(\"Using git_hash {}\".format(jit_git_hash))\n\n    logging.info(\"Uploading:\")\n    for item in files:\n        logging.info(\"  {}\".format(item))\n\n    try:\n        from azure.storage.blob import BlobServiceClient\n        from azure.identity import AzureCliCredential\n\n    except:\n        logging.warning(\"Please install:\")\n        logging.warning(\"  pip install azure-storage-blob\")\n        logging.warning(\"  pip install azure-identiy\")\n        logging.warning(\"See also https://learn.microsoft.com/azure/storage/blobs/storage-quickstart-blobs-python\")\n        raise RuntimeError(\"Missing azure storage or identity packages.\")\n\n    default_credential = AzureCliCredential()\n\n    blob_service_client = BlobServiceClient(account_url=az_blob_storage_account_uri, credential=default_credential)\n    blob_folder_name = \"{}/{}/{}/{}/{}\".format(az_builds_root_folder, jit_git_hash, coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type)\n\n    total_bytes_uploaded = 0\n\n    # Should we compress the JIT on upload? It would save space, but it makes it slightly more complicated to use\n    # because you can't just \"wget\" or otherwise download the file and use it immediately -- you need to unzip first.\n    # So for now, don't compress it.\n    compress_jit = False\n\n    with TempDir() as temp_location:\n        for file in files:\n            if compress_jit:\n                # Zip compress the file we will upload\n                zip_name = os.path.basename(file) + \".zip\"","sourceCodeStart":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/scripts/jitrollingbuild.py#L449-L485","documentation":"Thrown by upload_command() when the import of azure.storage.blob (BlobServiceClient) or azure.identity (AzureCliCredential) fails. The upload path requires authenticated Azure SDK access to write blobs to the clrjit2 storage account, which requires both Python packages to be installed.","triggerScenarios":"At lines 458-467, the script tries 'from azure.storage.blob import BlobServiceClient' and 'from azure.identity import AzureCliCredential'. If either import raises an exception (bare except), line 467 raises RuntimeError with instructions to pip install the packages.","commonSituations":"Running in a fresh Python environment or virtualenv without the Azure SDK packages installed. The packages are installed but for a different Python version (e.g., installed for python3.8 but running with python3.10). Corporate proxy or pip configuration prevents installing packages. The azure-identity package name was misspelled in the install command (the script's own warning message has a typo: 'azure-identiy').","solutions":["Install both packages: 'pip install azure-storage-blob azure-identity'.","On Windows, if pip is not on PATH: 'py -3 -m pip install azure-storage-blob azure-identity'.","Verify the packages are installed for the correct Python interpreter: 'python -c \"import azure.storage.blob; import azure.identity\"'.","Ensure you have also run 'az login' to authenticate with Azure CLI before attempting the upload."],"exampleFix":"# before: missing packages\npython jitrollingbuild.py upload -git_hash abc123\n# -> RuntimeError: Missing azure storage or identity packages.\n\n# after: install packages then retry\npip install azure-storage-blob azure-identity\naz login\npython jitrollingbuild.py upload -git_hash abc123","handlingStrategy":"validation","validationCode":"# Check Azure packages before calling upload\nimport importlib\ndef can_import_azure():\n    try:\n        importlib.import_module('azure.storage.blob')\n        importlib.import_module('azure.identity')\n        return True\n    except ImportError:\n        return False\n\nif not can_import_azure():\n    print('Missing Azure packages. Run: pip install azure-storage-blob azure-identity')","typeGuard":"def azure_packages_available() -> bool:\n    try:\n        import azure.storage.blob  # noqa\n        import azure.identity     # noqa\n        return True\n    except ImportError:\n        return False","tryCatchPattern":"try:\n    upload_command(coreclr_args)\nexcept RuntimeError as e:\n    if 'azure storage or identity' in str(e):\n        import subprocess\n        subprocess.run(['pip', 'install', 'azure-storage-blob', 'azure-identity'])\n        raise  # Re-raise so user retries after install\n    raise","preventionTips":["Install Azure packages upfront: 'pip install azure-storage-blob azure-identity'.","Run 'az login' before attempting uploads to authenticate with Azure CLI.","Verify the packages are installed for the correct Python interpreter."],"tags":["azure","dependencies","python-packages","jitrollingbuild","upload"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}