Give AlbumentationsX a star on GitHub — it powers this leaderboard

Star on GitHub

azure-mgmt-iothub

Microsoft Azure IoT Hub Management Client Library for Python

Rank: #1418Downloads: 7,198,929 (30 days)Stars: 5,497Forks: 3,248

Description

Microsoft Azure SDK for Python

This is the Microsoft Azure IoT Hub Management Client Library. This package has been tested with Python 3.8+. For a more complete view of Azure libraries, see the azure sdk python release.

Disclaimer

Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691

Getting started

Prerequisites

Install the package

pip install azure-mgmt-iothub
pip install azure-identity

Authentication

By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables.

  • AZURE_CLIENT_ID for Azure client ID.
  • AZURE_TENANT_ID for Azure tenant ID.
  • AZURE_CLIENT_SECRET for Azure client secret.

In addition, Azure subscription ID can be configured via environment variable AZURE_SUBSCRIPTION_ID.

With above configuration, client can be authenticated by following code:

from azure.identity import DefaultAzureCredential
from azure.mgmt.iothub import IotHubClient
import os

sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
client = IotHubClient(credential=DefaultAzureCredential(), subscription_id=sub_id)

Examples

Code samples for this package can be found at:

Troubleshooting

Next steps

Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in the Issues section of the project.

Release History

4.0.0 (2025-04-09)

Breaking Changes

  • Removed subfolders of some unused Api-Versions for smaller package size. If your application requires a specific and non-latest Api-Version, it's recommended to pin this package to the previous released version; If your application always only use latest Api-Version, please ignore this change.

3.0.0 (2023-09-19)

Features Added

  • Model RoutingEndpoints has a new parameter cosmos_db_sql_containers

Breaking Changes

  • Model RoutingCosmosDBSqlApiProperties has a new required parameter container_name
  • Model RoutingCosmosDBSqlApiProperties no longer has parameter collection_name
  • Model RoutingEndpoints no longer has parameter cosmos_db_sql_collections

2.4.0 (2023-04-20)

Features Added

  • Model IotHubProperties has a new parameter ip_version

2.4.0b1 (2023-02-15)

Other Changes

  • Added generated samples in github repo
  • Drop support for python<3.7.0

2.3.0 (2022-09-02)

Features Added

  • Model IotHubProperties has a new parameter device_streams
  • Model IotHubProperties has a new parameter encryption
  • Model IotHubProperties has a new parameter root_certificate
  • Model RoutingEndpoints has a new parameter cosmos_db_sql_collections

2.2.0 (2022-01-29)

Features

  • Model IotHubDescription has a new parameter system_data
  • Model IotHubProperties has a new parameter enable_data_residency

2.1.0 (2021-08-25)

Features

  • Model IotHubProperties has a new parameter disable_local_auth
  • Model IotHubProperties has a new parameter disable_device_sas
  • Model IotHubProperties has a new parameter restrict_outbound_network_access
  • Model IotHubProperties has a new parameter allowed_fqdn_list
  • Model IotHubProperties has a new parameter disable_module_sas
  • Model CertificateBodyDescription has a new parameter is_verified

2.0.0 (2021-05-14)

Features

  • Model EndpointHealthData has a new parameter last_send_attempt_time
  • Model EndpointHealthData has a new parameter last_known_error_time
  • Model EndpointHealthData has a new parameter last_known_error
  • Model EndpointHealthData has a new parameter last_successful_send_attempt_time
  • Model ImportDevicesRequest has a new parameter identity
  • Model ImportDevicesRequest has a new parameter configurations_blob_name
  • Model ImportDevicesRequest has a new parameter include_configurations
  • Model RoutingServiceBusTopicEndpointProperties has a new parameter identity
  • Model RoutingStorageContainerProperties has a new parameter identity
  • Model StorageEndpointProperties has a new parameter identity
  • Model IotHubDescription has a new parameter identity
  • Model IotHubProperties has a new parameter network_rule_sets
  • Model ExportDevicesRequest has a new parameter identity
  • Model ExportDevicesRequest has a new parameter configurations_blob_name
  • Model ExportDevicesRequest has a new parameter include_configurations
  • Model RoutingServiceBusQueueEndpointProperties has a new parameter identity
  • Model RoutingEventHubProperties has a new parameter identity

Breaking changes

  • Operation IotHubResourceOperations.create_event_hub_consumer_group has a new signature

1.0.0 (2020-12-18)

  • GA release

1.0.0b1 (2020-11-12)

This is beta preview version.

This version uses a next-generation code generator that introduces important breaking changes, but also important new features (like unified authentication and async programming).

General breaking changes

  • Credential system has been completly revamped:

    • azure.common.credentials or msrestazure.azure_active_directory instances are no longer supported, use the azure-identity classes instead: https://pypi.org/project/azure-identity/
    • credentials parameter has been renamed credential
  • The config attribute no longer exists on a client, configuration should be passed as kwarg. Example: MyClient(credential, subscription_id, enable_logging=True). For a complete set of supported options, see the parameters accept in init documentation of azure-core

  • You can't import a version module anymore, use __version__ instead

  • Operations that used to return a msrest.polling.LROPoller now returns a azure.core.polling.LROPoller and are prefixed with begin_.

  • Exceptions tree have been simplified and most exceptions are now azure.core.exceptions.HttpResponseError (CloudError has been removed).

  • Most of the operation kwarg have changed. Some of the most noticeable:

General new features

  • Type annotations support using typing. SDKs are mypy ready.
  • This client has now stable and official support for async. Check the aio namespace of your package to find the async client.
  • This client now support natively tracing library like OpenCensus or OpenTelemetry. See this tracing quickstart for an overview.

0.12.0 (2020-05-12)

Features

  • Model RoutingEventHubProperties has a new parameter entity_path
  • Model RoutingEventHubProperties has a new parameter authentication_type
  • Model RoutingEventHubProperties has a new parameter endpoint_uri
  • Model RoutingEventHubProperties has a new parameter id
  • Model RoutingServiceBusQueueEndpointProperties has a new parameter entity_path
  • Model RoutingServiceBusQueueEndpointProperties has a new parameter authentication_type
  • Model RoutingServiceBusQueueEndpointProperties has a new parameter endpoint_uri
  • Model RoutingServiceBusQueueEndpointProperties has a new parameter id
  • Model ImportDevicesRequest has a new parameter authentication_type
  • Model ImportDevicesRequest has a new parameter output_blob_name
  • Model ImportDevicesRequest has a new parameter input_blob_name
  • Model ExportDevicesRequest has a new parameter authentication_type
  • Model ExportDevicesRequest has a new parameter export_blob_name
  • Model RoutingServiceBusTopicEndpointProperties has a new parameter entity_path
  • Model RoutingServiceBusTopicEndpointProperties has a new parameter authentication_type
  • Model RoutingServiceBusTopicEndpointProperties has a new parameter endpoint_uri
  • Model RoutingServiceBusTopicEndpointProperties has a new parameter id
  • Model RoutingStorageContainerProperties has a new parameter authentication_type
  • Model RoutingStorageContainerProperties has a new parameter endpoint_uri
  • Model RoutingStorageContainerProperties has a new parameter id
  • Model IotHubProperties has a new parameter public_network_access
  • Model IotHubProperties has a new parameter private_endpoint_connections
  • Model IotHubProperties has a new parameter min_tls_version
  • Model StorageEndpointProperties has a new parameter authentication_type
  • Added operation group PrivateEndpointConnectionsOperations
  • Added operation group PrivateLinkResourcesOperations

Breaking changes

  • Operation IotHubResourceOperations.export_devices has a new signature
  • Operation IotHubResourceOperations.import_devices has a new signature

0.11.0 (2020-03-17)

  • Preview API versions 2018-12-01-preview, 2019-03-22-preview, 2019-07-01-preview included

0.10.0 (2020-01-09)

Features

  • Support for multi-api

Breaking changes

  • Model IotHubProperties no longer has parameter device_streams

0.9.0 (2019-10-09)

  • Release 0.9.0 as stable.

0.9.0rc1 (2019-09-29)

Features

  • Model Iot