{"id":1367,"library":"azure-mgmt-iothubprovisioningservices","title":"Azure IoT Hub Provisioning Services Management","description":"The Microsoft Azure IoT Hub Provisioning Services Client Library for Python (`azure-mgmt-iothubprovisioningservices`) provides management capabilities for IoT Hub Device Provisioning Service (DPS) resources within Azure. It allows developers to programmatically create, configure, and manage DPS instances, enrollments, and linked IoT hubs. The current stable version is 1.1.0, and it is part of the actively maintained Azure SDK for Python, which follows a regular release cadence with updates and bug fixes.","status":"active","version":"1.1.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python","tags":["azure","iot","provisioning","dps","management","cloud"],"install":[{"cmd":"pip install azure-mgmt-iothubprovisioningservices azure-identity","lang":"bash","label":"Install library and authentication package"}],"dependencies":[{"reason":"Required for Azure Active Directory token authentication with DefaultAzureCredential.","package":"azure-identity","optional":false},{"reason":"Historically used for Azure-specific credentials; largely replaced by azure-identity in newer SDK versions.","package":"msrestazure","optional":true}],"imports":[{"note":"The primary client class is IotDpsClient, directly under the top-level package. Older patterns might use different class names or sub-module imports which are no longer standard or might be specific to previous beta versions.","wrong":"from azure.mgmt.iothubprovisioningservices.iot_hub_provisioning_services_client import IotHubProvisioningServicesClient","symbol":"IotDpsClient","correct":"from azure.mgmt.iothubprovisioningservices import IotDpsClient"},{"note":"Standard authentication class for Azure SDKs.","symbol":"DefaultAzureCredential","correct":"from azure.identity import DefaultAzureCredential"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.iothubprovisioningservices import IotDpsClient\n\n# Set your Azure Subscription ID and Resource Group name as environment variables\n# export AZURE_SUBSCRIPTION_ID=\"<your-subscription-id>\"\n# export AZURE_RESOURCE_GROUP_NAME=\"<your-resource-group-name>\"\n\nsubscription_id = os.environ.get(\"AZURE_SUBSCRIPTION_ID\", \"\").strip()\nresource_group_name = os.environ.get(\"AZURE_RESOURCE_GROUP_NAME\", \"\").strip()\n\nif not subscription_id or not resource_group_name:\n    raise ValueError(\"Please set AZURE_SUBSCRIPTION_ID and AZURE_RESOURCE_GROUP_NAME environment variables.\")\n\n# Authenticate with Azure. DefaultAzureCredential attempts several credential types.\ncredential = DefaultAzureCredential()\n\n# Create an IoT Hub Provisioning Services client\nclient = IotDpsClient(credential, subscription_id)\n\nprint(f\"Listing all IoT Hub Provisioning Services in resource group '{resource_group_name}'...\")\n\n# List provisioning services in a specific resource group\nfor dps in client.iot_dps_resource.list_by_resource_group(resource_group_name):\n    print(f\"  - {dps.name} (Location: {dps.location}, Sku: {dps.sku.name})\")\n\nprint(\"Done.\")","lang":"python","description":"This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and list all IoT Hub Provisioning Services within a specified resource group. Ensure you have `AZURE_SUBSCRIPTION_ID` and `AZURE_RESOURCE_GROUP_NAME` set as environment variables. `DefaultAzureCredential` will automatically try to pick up credentials from your environment (e.g., Azure CLI, environment variables, Managed Identity)."},"warnings":[{"fix":"Migrate to `azure-identity` classes (e.g., `DefaultAzureCredential`) for authentication and pass the credential object via the `credential` parameter.","message":"The credential system was completely revamped in beta versions leading up to 1.0.0. `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported. The `credentials` parameter was renamed to `credential`.","severity":"breaking","affected_versions":"<= 0.x (pre-1.0.0b1) and early 1.0.0b1"},{"fix":"Pass configuration options like `polling_interval` or `retry_total` directly as keyword arguments to the client constructor (e.g., `IotDpsClient(credential, subscription_id, enable_logging=True)`).","message":"The `config` attribute no longer exists directly on the client object for passing configuration. Client configuration should now be passed as keyword arguments during client instantiation.","severity":"breaking","affected_versions":"<= 0.x (pre-1.0.0b1) and early 1.0.0b1"},{"fix":"Adjust code to call methods like `begin_create_or_update` instead of `create_or_update` for LROs, and use the `azure.core.polling.LROPoller` object returned.","message":"Long-running operations (LROs) that previously returned `msrest.polling.LROPoller` now return `azure.core.polling.LROPoller` and are prefixed with `begin_`.","severity":"breaking","affected_versions":"<= 0.x (pre-1.0.0b1) and early 1.0.0b1"},{"fix":"Ensure all necessary Azure authentication environment variables are correctly set for your chosen authentication method, or explicitly provide credential details.","message":"Incorrect or missing environment variables are a common cause of authentication failures when using `DefaultAzureCredential`. This credential type relies on specific environment variables (e.g., `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_SUBSCRIPTION_ID`) to locate credentials.","severity":"gotcha","affected_versions":"All versions using `azure-identity`"},{"fix":"Ensure your development and deployment environment uses Python 3.6 or later (Python 3.8+ is recommended for the broader Azure SDK).","message":"Python 2.7 support for Azure SDK Python packages ended on January 1, 2022. While older versions might have been compatible, newer versions are designed for Python 3.6+.","severity":"deprecated","affected_versions":"All versions after 0.x"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}