Skip to content
This repository was archived by the owner on Jun 13, 2026. It is now read-only.
This repository was archived by the owner on Jun 13, 2026. It is now read-only.

Cannot import name 'INSTRUMENTATION_KEY' from 'azure.ai.ml._telemetry.logging_handler' #245

Description

@mk-orange

Trying to follow example:

  • Search index must be created /workspaces/contoso-chat/data/manual_info/contoso-manuals-index.ipynb
%pip install azure-ai-generative[evaluate,index,prompty]
import os
from azure.ai.resources.client import AIClient
from azure.ai.resources.operations._index_data_source import (
    LocalSource,
    ACSOutputConfig,
)
from azure.ai.generative.index import build_index
from azure.identity import DefaultAzureCredential
from dotenv import load_dotenv
  • AIClient import produces error
ImportError                               Traceback (most recent call last)
Cell In[1], line 2
      1 import os
----> 2 from azure.ai.resources.client import AIClient
      3 from azure.ai.resources.operations._index_data_source import (
      4     LocalSource,
      5     ACSOutputConfig,
      6 )
      7 from azure.ai.generative.index import build_index

File ~/.local/lib/python3.11/site-packages/azure/ai/resources/__init__.py:9
      5 __path__ = __import__("pkgutil").extend_path(__path__, __name__)  # type: ignore
      7 import logging
----> 9 from ._telemetry import initialize_logger_info
     11 module_logger = logging.getLogger(__name__)
     12 initialize_logger_info(module_logger, terminator="\n")

File ~/.local/lib/python3.11/site-packages/azure/ai/resources/_telemetry/__init__.py:10
      7 from azure.ai.ml._telemetry import ActivityType, log_activity, monitor_with_activity, monitor_with_telemetry_mixin
      8 from azure.ai.ml._utils._logger_utils import initialize_logger_info
---> 10 from .logging_handler import get_appinsights_log_handler, ActivityLogger
     12 __all__ = [
     13     "monitor_with_activity",
     14     "monitor_with_telemetry_mixin",
...
---> 25 from azure.ai.ml._telemetry.logging_handler import in_jupyter_notebook, CustomDimensionsFilter, INSTRUMENTATION_KEY
     26 from azure.ai.resources._version import VERSION
     29 USER_AGENT = "{}/{}".format("azure-ai-resources", VERSION)

ImportError: cannot import name 'INSTRUMENTATION_KEY' from 'azure.ai.ml._telemetry.logging_handler' (/home/vscode/.local/lib/python3.11/site-packages/azure/ai/ml/_telemetry/logging_handler.py)
%pip install azure-ai-evaluation
  • still same error

Metadata

Metadata

Labels

prior versionThis issue was on older version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions