Install & Compatibility
Where this runs
tested against v9.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 43.6MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.8s · import 0.000s · 44MB
42MB installed
● package 42MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
IotCentralManagementClient
✓ from azure.mgmt.iotcentral import IotCentralManagementClient
DefaultAzureCredential
✓ from azure.identity import DefaultAzureCredential
✗ from msrestazure.azure_active_directory import ServicePrincipalCredentials
DefaultAzureCredential is the recommended and modern way to authenticate across environments, replacing older credential types.
This quickstart demonstrates how to authenticate with `DefaultAzureCredential`, create an `IotCentralManagementClient`, and then list all IoT Central applications within your Azure subscription. It also includes an example of retrieving a specific application by name and resource group.
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.iotcentral import IotCentralManagementClient
# Retrieve your subscription ID from an environment variable or replace with your actual ID
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "")
if not subscription_id:
raise ValueError("AZURE_SUBSCRIPTION_ID environment variable not set.")
# Authenticate using DefaultAzureCredential.
# This credential will attempt to authenticate in several ways, including
# environment variables, managed identity, Azure CLI, and Visual Studio Code.
credential = DefaultAzureCredential()
# Create an IoT Central Management client
client = IotCentralManagementClient(credential, subscription_id)
# List all IoT Central applications in the subscription
print("Listing all IoT Central applications in the subscription:")
for app in client.apps.list_by_subscription():
print(f"- App Name: {app.display_name or app.name}, Location: {app.location}, SKU: {app.sku.name}")
# Example: Get an existing IoT Central application by name within a resource group
# Replace with an actual app name and resource group you have, or set via environment variables
resource_group_name = os.environ.get("AZURE_RESOURCE_GROUP", "my-resource-group")
iot_central_app_name = os.environ.get("AZURE_IOTCENTRAL_APP_NAME", "my-iotc-app")
if resource_group_name and iot_central_app_name:
try:
print(f"\nAttempting to get app '{iot_central_app_name}' in resource group '{resource_group_name}':")
app_details = client.apps.get(resource_group_name, iot_central_app_name)
print(f"Found app: {app_details.display_name or app_details.name}, SKU: {app_details.sku.name}, ID: {app_details.id}")
except Exception as e:
print(f"Could not retrieve app {iot_central_app_name} (might not exist, permission issue, or incorrect RG/name): {e}")
else:
print("\nSkipping 'Get app' example: AZURE_RESOURCE_GROUP or AZURE_IOTCENTRAL_APP_NAME not set.")
Debug
Known issues
breakingMajor version updates (e.g., v8.x to v9.x) in Azure management plane SDKs often introduce breaking changes due to underlying REST API version updates or SDK design changes. This typically affects method signatures, parameter names, and object models.fixRefer to the official migration guides in the Azure SDK for Python documentation for specific changes between major versions. Update code to use new method signatures and object structures.
affects: 8.x.x to 9.x.x
gotchaMany resource creation or update operations (e.g., `create_or_update`) are long-running operations (LROs) and return a poller object. Failing to call `.result()` on the poller will mean the operation might not have completed when you expect, potentially leading to errors if you immediately try to use the resource.fixAlways call `.result()` on the poller object returned by LROs: `resource = client.apps.begin_create_or_update(...).result()`.
affects: All versions
gotchaList operations (e.g., `client.apps.list_by_subscription()`) return an iterable that yields results lazily. If you only iterate a few times or convert it to a list without iterating fully, you might not retrieve all resources, especially in subscriptions with many items.fixAlways iterate completely over the returned iterable, for example, using a `for` loop: `for item in client.apps.list_by_subscription(): ...`.
affects: All versions
deprecatedDirect use of `ServicePrincipalCredentials` or `AzureCliCredential` from older modules (like `msrestazure.azure_active_directory`) is deprecated in favor of `azure-identity`'s `DefaultAzureCredential` or more specific credential types.fixMigrate authentication to use `azure-identity.DefaultAzureCredential`. This provides a robust and flexible authentication mechanism that works across various Azure environments without code changes.
affects: < 9.0.0 (and older SDK patterns)
breakingThe `azure-mgmt-iotcentral` library, particularly some versions or their transitive dependencies, relies on the `six` compatibility library. A `ModuleNotFoundError` will occur if `six` is not present in the Python environment, preventing the library from being imported and used.fixEnsure the `six` library is installed in your environment by running `pip install six`. While `six` is typically installed automatically as a dependency, it might be missed in custom or minimal Python environments.
affects: All versions (when 'six' is not available in the environment)
breakingThe `azure-mgmt-iotcentral` library has a dependency on the `six` package, which is not being met, leading to a `ModuleNotFoundError` during import. This indicates that `six` is not automatically installed as a dependency by the package manager.fixInstall the `six` package explicitly using `pip install six` before installing or using `azure-mgmt-iotcentral`.
affects: All versions (if 'six' not explicitly installed)
Upgrade
Version history
9.0.1latest on PyPI · released May 18, 2026
Audit
Dependencies
azure-identityrequiredRequired for authentication using Azure Active Directory, highly recommended for production.
azure-corerequiredBase components for the Azure SDK for Python, automatically installed.