CREATING A MICROSOFT AZURE CONNECTION
The Azure IoT Hub connector sends the uplinks of your devices to an Azure IoT hub, as device-to-cloud telemetry messages, and receives the downlinks of the devices as cloud-to-device messages. It connects to the IoT hub with the AMQPS protocol. Each device is a device of the IoT hub, identified by its DevEUI in uppercase.
The data follows this path: LoRaWAN® device → ThingPark Enterprise → ThingPark X IoT Flow connection → Azure IoT Hub.
Before you create the connection, you need an Azure IoT hub, on a free or a paid subscription. This page gives a minimal setup example. Check Azure IoT Hub pricing and IoT Hub limits to decide which subscription fits your needs.
If you plan to manage more than 65,500 devices, please consider migrating to Azure Event Hubs. Its architecture is more suitable for a large number of devices. Use one exclusive connection per IoT Hub when downlinks are required. If several connections must share the same IoT Hub, disable exclusive mode on all but one of them. See Azure limitations.
Creating an Azure IoT Hub
-
Go to the Azure Portal.
-
Click Create a resource.

-
Search for and select IoT Hub.

-
Click Create.

-
Fill in the Basics tab:

| Field | Description |
|---|---|
| Subscription | Subscription to use for your IoT hub. |
| Resource Group | New resource group, or an existing one. |
| Region | Region of your hub. Select the location closest to you. |
| IoT Hub Name | Name of your IoT hub. This name must be globally unique. |
-
Click Next: Networking. Select the connectivity method and click Next: Management.

-
Fill in the Management tab depending on your needs, then click Next: Add-ons. Make sure that the shared access policies are enabled.

| Field | Description |
|---|---|
| Pricing and scale tier | Tier of the hub, depending on the features you need and on the number of messages your solution sends per day. |
| IoT Hub units | The number of messages allowed per unit per day depends on the tier of your hub. For example, for an IoT hub that supports the ingress of 700,000 messages, choose two S1 units. |
| Advanced/Device-to-cloud partitions | Number of partitions of the device-to-cloud messages, which relates to the number of simultaneous readers of the messages. |
The number of units plays an important role in quotas and throttling.
Example
| Throttle | S1 | S2 | S3 |
|---|---|---|---|
| Device-to-Cloud sends | 12 /sec/unit | 120 /sec/unit | 6,000 /sec/unit |
| Number of messages per day | 400,000 | 6,000,000 | 300,000,000 |
The number of devices depends on the subscriptions that you buy. For more information, see the pricing details.
This means that in order to reach a throughput of 300 uplinks/sec you need a minimum S1 subscription with 25 units (25 x 12 = 300).
The minimum D2C is 100 msg/sec, so even with S1 and 1 unit you can send 100 uplinks/sec. Starting with S1 and 9+ units, you can get above 100 msg/sec.
Another limitation is on the registry operations. Devices can be created dynamically, on the first uplink they send to the Azure connection. When there are many create operations at runtime, the registration of the devices can take time.
For example, registering 10,000 devices at the same time can take 100 min with an S1 subscription with one unit (10,000/100), and 4 min with an S1 subscription with 25 units (10,000/(25*100)).
The following table shows the enforced throttles. Values refer to an individual hub.
| Throttle | S1 | S2 | S3 |
|---|---|---|---|
| Identity registry operations (individual or bulk import/export operations) | 1.67/sec/unit (100/min/unit) | 1.67/sec/unit (100/min/unit) | 83.33/sec/unit (5,000/min/unit) |
-
In the Add-ons tab, you can add other Microsoft services if needed. They are not required by ThingPark. Click Next: Tags.

-
You can add one or several tags. Then, click Next: Review + create.

-
After reviewing the details, click Create.

-
Wait until the deployment of the hub is complete.
-
Click Go to resource. The details of your IoT hub are displayed.

Collecting Expected Information
Parameters required
| UI Field | Description |
|---|---|
| Name | Name of the connection. |
| Hostname | Host name of your Azure IoT hub, for example myaccountname.azure-devices.net. |
| Access Policy Name | Name of a shared access policy of the IoT hub, for example iothubowner. |
| Shared Access Key | Primary or secondary key of this shared access policy. |
| IoT Hub Tier | Pricing and scale tier of your IoT hub: Free (F1), Basic level 1 (B1), Basic level 2 (B2), Basic level 3 (B3), Standard level 1 (S1), Standard level 2 (S2) or Standard level 3 (S3). Default Free (F1). |
| IoT Hub Units | Number of units of your IoT hub. Default 1. The Free tier has only 1 unit. A level 1 or 2 tier can have up to 200 units. A level 3 tier can have up to 10 units. |
| Description | Optional description of the connection. |
The following settings are in the connection details, once the connection is created:
| UI Field | Description |
|---|---|
| Exclusive IoT-Hub | On by default. See Exclusive IoT-Hub mode. |
| Downlink port | In the Advanced Settings section. When downlinks are enabled, LoRaWAN® port used to send the downlinks to the device. |
For detailed information on Microsoft Azure IoT configuration and parameters, see the Azure IoT Hub documentation.
Getting the Information From the Azure Portal
-
Log in to the Azure Portal.
-
The main page shows the resources that you have created.
-
Select your IoT hub, TPX-Connector in this example.
-
The Overview page gives the Hostname, the Pricing and scale tier and the Number of IoT Hub units.
-
Open Shared access policies, under Security settings in the left panel. The page lists the policies that exist by default. Make sure that the Connect using shared access policies option is set to Allow.

-
To use an existing shared access policy, select iothubowner: this is the Access Policy Name. The panel that opens on the right gives its Primary key and Secondary key.

-
Or create a new shared access policy:
- Click Add shared access policy.
- Enter a name for the policy, for example
actility-policy. - Allow the Registry read, Registry write and Device connect permissions.
- The new policy appears in the list. Select it: the panel on the right gives its name and its primary and secondary keys.
-
Creating a Connection With UI
-
In ThingPark Enterprise, click Connections -> + Add Connection -> ThingPark X IoT Flow.

-
In ThingPark X IoT Flow, click Azure IoT Hub in the list of connectors.

-
Fill in the form:
- Name: a clear name for the connection, for example
My Azure IoT Hub Connection. - Hostname: the host name of your IoT hub, given on its Overview page.
- Access Policy Name: the name of the shared access policy, for example
iothubowner. - Shared Access Key: the primary or secondary key of this policy.
- IoT Hub Tier: the pricing and scale tier given on the Overview page of your IoT hub.
- IoT Hub Units: the number of IoT hub units given on the same page.
- Description: optional.

- Name: a clear name for the connection, for example
-
Click Create. A notification confirms that the connection has been created, and the connection details open.
-
In the connection details, check that the connection is OPENED (see Connection States).
Parameters marked with * are mandatory.
Creating a Connection With API
The Actility Azure connection uses AMQPS protocol.
You need to create the connection prior to creating the flow.
The creation of a connection establishes a link from ThingPark Wireless to the cloud provider that you want to associate a Device with. The link can be used to transport any Uplink regardless the DevEUI parameter.
The DevEUI must be always in upper case.
Azure IoT Hub allows only one active connection per device.
To do this, you need to use the following endpoints.
POST/connectionsfor creationPUT/connectionsfor modificationDELETE/connectionsfor deletion
When you update a configuration property on a connection, you must provide the whole configuration properties again.
Example of the creation of a connection:
POST /connections
{
"connectorId": "actility-azure-iot",
"name": "Azure Connection",
"configuration": {
"description": "Azure Datacenter",
"hostName": "demo.azure-devices.net",
"sharedAccessKeyName": "iothubowner",
"sharedAccessKey": "{YOUR-SHARED-ACCESS-KEY}",
"iotHubTier": "S1",
"iotHubUnits": 25
}
}
The following table lists the expected results of the properties when applied:
| Property | Expected results |
|---|---|
connectorId | Set to actility-azure-iot. |
configuration/hostName | Defines the host of the Azure IoT Hub to use. |
configuration/sharedAccessKeyName | Shared Access Policy name for accessing the Azure IoT Hub. |
configuration/sharedAccessKey | Primary or Secondary key for accessing the Azure IoT Hub. |
configuration/iotHubTier | Pricing and scale tier of the Azure IoT Hub. |
configuration/iotHubUnits | Number of IoT Hub units of the Azure IoT Hub. |
configuration/downlinkEnabled | true (default) for the Exclusive IoT-Hub mode, false for a shared, uplink-only access. See Exclusive IoT-Hub mode. |
All properties are not present in this example. You can check the rest of these properties in the common parameters section.
Azure IoT Hub Certificate Migration

Azure IoT Hub used TLS certificates issued by the Baltimore CyberTrust Root, which expires in 2025. Starting in February 2023, all IoT hubs in the global Azure cloud migrate to a new TLS certificate issued by the DigiCert Global Root G2.
Actility has tested this certificate migration according to the Azure recommendations: the connector is compatible with the new certificate.
Displaying Information to Know if It Worked
First, collect the connection string of your Azure IoT hub:
-
In the Azure portal, select your IoT hub.
-
In the Shared access policies page, select the policy used by the connection.
-
Copy the Primary connection string.
Example of connection string: HostName=<IoT Hub name>.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=<primary key>
Using Azure IoT Explorer
-
Install the latest Azure IoT Explorer for your operating system: the file with the .msi extension for Windows, .deb for Linux.
-
Open the application and click Add connection.

-
Enter the Connection string of your IoT hub, and click Save.

-
Azure IoT Explorer lists the devices of the IoT hub. Click a device ID to inspect the device and monitor its telemetry.

Using Azure CLI
-
Install the latest Azure CLI.
-
Install the Azure IoT Extension for Azure CLI:
az extension add --name azure-iot
- Run the following command to monitor the events of a device:
az iot hub monitor-events -n {iothub_name} --login {iothub_connection_string} -d {device_id}
Example:
az iot hub monitor-events -n iot-hub-tests --login "HostName=iot-hub-tests.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey={YOUR-SHARED-ACCESS-KEY}" -d 17zp509311000493
The uplinks of the device are displayed:

Limitations
Currently, the Actility Azure connection supports up to 32,750 devices when Exclusive IoT-Hub mode is enabled and 65,500 devices when it is disabled, in the same IoT Hub. This limitation is due to the maximum number of Device-to-cloud telemetry and Cloud-to-device links that the Azure SDK can open concurrently. If you reach this limit, new devices are not taken into account, and restarting the connection does not guarantee that the same devices will be established. Azure Event Hubs is a more stable solution for larger deployments.
The connector supports only device-to-cloud telemetry sends (D2C) for uplinks and cloud-to-device sends (C2D) for downlinks. Other Azure operations like File upload, Direct methods or Device Twin are not supported.
All other limits are imposed by Azure based on the subscription and the number of units.
To select the subscription that fits your case check the IoT Hub limits documentation.
The Device Identifier (DevEUI) must be in uppercase on the Azure IoT Hub side.
Exclusive IoT-Hub mode
The Exclusive IoT-Hub option controls how ThingPark X IoT Flow creates Azure device links. It is enabled by default in the UI and in the API configuration.
- Enabled: ThingPark X IoT Flow establishes bidirectional links for the devices in the IoT Hub. It lists the existing devices when the connection starts, opens both uplink and downlink links, and supports downlinks. Only one active connection can own the downstream link for a device. Do not enable this mode on multiple connections that use the same IoT Hub.
- Disabled: ThingPark X IoT Flow does not open downlink links and does not list all existing devices at startup. It creates an uplink link on demand when a device sends an uplink. This mode supports multiple connections sharing one IoT Hub for uplinks, but those connections cannot receive downlinks.
In the API, this UI option is represented by configuration.downlinkEnabled for backward compatibility. Set it to true for Exclusive IoT-Hub mode or false for shared uplink-only access. The API does not use an exclusiveIoTHub property.
If multiple connections use the same IoT Hub with Exclusive IoT-Hub mode enabled, they collide on downstream links because Azure allows only one active downstream link per device.
A Link errors event is stored in the Event table. Each connection retries to acquire downstream links every minute, but the collision continues until only one exclusive connection per IoT Hub remains. Disable Exclusive IoT-Hub mode on the other connections by setting downlinkEnabled=false.
Another downside of this collision is that upstream links will not be able to enforce proper rate limiter when sending uplinks.
The reason is that the rate limiter is not shared between connections and each connection will push uplinks at a maximum possible rate according to the IoT Hub subscription.
However, at some point it may exceed the global IoT Hub rate per minute and uplinks may start to be Rejected by Azure.
A way to avoid downstream-link collisions is to set downlinkEnabled=false on most concurrent connections and leave it set to true (the default) on only one connection. Uplinks can then be sent through multiple connections, while downlinks are received through one exclusive connection.
When downlinkEnabled=false, the Azure connection does not list existing devices in the IoT Hub and creates uplink links lazily when devices send their first uplink.
Troubleshooting
The following table lists the common error codes returned by Azure IoT Hub AMQP Broker:
| Error code | Error description | Comments |
|---|---|---|
amqp:internal-error | Another AMQP Client has opened a Receive Link | The device is already used by another AMQP client. Setting downlinkEnabled=false on the other connections to the same IoT Hub prevents downstream-link collisions. Check the Link errors events in the event log. |
amqp:not-allowed | Device used by another AMQP client, like the above error code | |
amqp:not-found | Device not found due to case sensitive device id or because it is not anymore on the IoT Hub. There is no action to perform. The device links will be closed and removed from the Azure Connection. IoT-Flow uses uppercase deviceEUI / device id. | |
amqp:internal-error | Device Not Found ErrorCode:DeviceNotFound ... | Device deleted manually from the Cloud side. Azure will close the device links after 1-2 minutes. There is no action to perform. The device links will be closed and removed from the Azure Connection. |
amqp:link:detach-forced | Server Busy. Please retry operation | When Azure is overloaded, it will detach the device links. The device links will be retried automatically every 1 min. |
amqp:resource-limit-exceeded | Total number of messages on IotHub '...' exceeded the allocated quota. Max allowed message count : '...', current message count : '...'. Send and Receive operations are blocked for this hub until the next UTC day. Consider increasing the units for this hub to increase the quota ... | When the daily quota of messages is reached, the Azure IoT Hub rejects new message exchange. The Azure connection will close. The supervisor will retry the connection based on reconnectStrategy. However, until the next day this connection will not be able to re-open it successfully. If you need to send more messages until the next day, you need to manually increase the hub units from your IoT Hub Dashboard. Update the connection configuration with the new iotHubUnits number. |
Device number limit exceeded | Total number of devices IotHub '...' exceeded the maximum that can be allocated. | The maximum is 32,750 devices in Exclusive IoT-Hub mode and 65,500 devices when it is disabled. |
IotHubQuotaExceeded | Total number of messages on the IoT Hub exceeded the allocated quota. | Increase units for this hub to increase the quota. |