Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
This library is an internal dependency of the Azure CLI and is not designed for direct interaction by end-users. Direct programmatic use is not recommended, and there is no public API or quickstart for standalone usage. Telemetry collection, which this package facilitates, is controlled via the Azure CLI's configuration settings.
# This library is an internal dependency of the Azure CLI and is not designed for direct interaction by end-users.
# Telemetry collection, which this package facilitates, can be configured or disabled
# via the Azure CLI's configuration settings.
# To disable telemetry for the Azure CLI:
# az config set core.collect_telemetry=False
# For more information on Azure CLI configuration, refer to the official Microsoft documentation.
Debug
Known issues
gotchaThis library is an internal component of the Azure CLI and is not intended for direct installation or programmatic use by end-users. Its internal APIs are not stable and may change without notice, potentially breaking user applications if directly depended upon. [6, 7, 8, 9]fixDo not install or use `azure-cli-telemetry` as a standalone dependency in end-user applications. Rely on the `azure-cli` package and its official public interfaces for Azure interactions.
affects: All versions
gotchaTelemetry collection by the Azure CLI (which this package enables) is opt-out and enabled by default. To disable telemetry, you must use the `az config set core.collect_telemetry=False` command within the Azure CLI itself, rather than trying to configure this Python package directly. [4, 14]fixUse the Azure CLI configuration command: `az config set core.collect_telemetry=False`. You can verify the setting with `az config get core.collect_telemetry`.
affects: All versions
gotchaThe version of the `azure-cli-telemetry` package (e.g., 1.1.0) is independent of the main `azure-cli` version (e.g., 2.85.0). Users might encounter issues where the telemetry component appears 'stuck' at an older version even after upgrading the main CLI. [18]fixWhile `azure-cli` versions 2.40.0 and later addressed some update issues for telemetry, generally avoid manually updating this component. If issues persist, a full reinstallation of the Azure CLI is recommended. [18, 22]
affects: < 2.40.0 of azure-cli (fix applied in later CLI versions, but the version independence remains)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'azure-cli-telemetry'
The 'azure-cli-telemetry' package is an internal component of the Azure CLI and is not intended for direct installation or use by end-users.
fixEnsure that the Azure CLI is properly installed and up to date; avoid attempting to install 'azure-cli-telemetry' separately.
ImportError: cannot import name 'telemetry' from 'azure.cli'
The 'telemetry' module is not exposed for direct import from 'azure.cli' as it is intended for internal use within the Azure CLI.
fixAvoid importing internal modules; use the Azure CLI commands as documented without attempting to access internal components.
AttributeError: module 'azure.cli.core' has no attribute 'telemetry'
The 'telemetry' attribute is not publicly available in 'azure.cli.core' as it is designed for internal use within the Azure CLI.
fixDo not attempt to access internal attributes; utilize the Azure CLI's public APIs and commands as intended.
ImportError: DLL load failed while importing win32file: The specified module could not be found.
This `ImportError` frequently appears in tracebacks involving `azure-cli-telemetry` (as it's part of the Azure CLI's dependencies) and indicates a corrupted or incomplete installation of the Azure CLI, particularly on Windows systems, often after an upgrade.
fixThe most effective fix is to completely uninstall the Azure CLI and then perform a fresh reinstallation using the official installer (MSI for Windows). This resolves issues related to corrupted Python environments or missing DLLs within the CLI's bundled dependencies.
ImportError: cannot import name '__version__' from 'azure.cli.telemetry'
This specific `ImportError` was a known bug in older versions of the Azure CLI (e.g., around `azure-cli 2.11.1`), where the `azure.cli.telemetry` module's internal structure or its `__version__` attribute was not correctly exposed or handled during import.
fixUpgrade your Azure CLI to the latest stable version. This bug was addressed in subsequent Azure CLI releases (e.g., `azure-cli 2.12.0` and later).
Upgrade
Version history
1.1.0latest on PyPI · released Aug 1, 2023
Audit
Dependencies
applicationinsightsrequiredUsed for sending telemetry data to Azure Application Insights.
portalockerrequiredUsed for managing file locks, likely for telemetry payload handling or process coordination.
azure-cli-corerequiredThis package is an internal dependency of the main Azure CLI and relies on core CLI components. [9]