Home > database >  Is there a limit of one process per connection string for connecting to Azure?
Is there a limit of one process per connection string for connecting to Azure?

Time:08-09

[background]
We are considering a mechanism in which Azure-C-SDK is applied to multiple processes and each process accumulates data in Azure.
Since there are multiple processes but one system, I wanted to use the same connection string.

[inspection result]
When I try to connect multiple processes to Azure with one connection string, when one process connects, the others get disconnected.

[question]
Is there a limit of one process per connection string for connecting to Azure?
So multiple processes can't connect with one connection string?

CodePudding user response:

Yes. There is a limit of one [MQTT] connection per connection string. Most connections are from devices, so one device connection per connection string is a more accurate statement.

Now in code, I often create a single MQTT client object, and use it throughout the code, sending and receiving messages as needed.

Other things to consider, you are not really limited on the number of devices (aka connection strings) in IoT Hub. You can also have a single device with multiple child objects (module identities) that have unique connection strings.

Lastly, you can use Device Provisioning service to create 'devices' as needed, so if you have a software solution that needs say 3 unique connections, simply call DPS to get 3 unique connection strings.

  • Related