Allocation policies in DPS
Allocation policies in DPS determine how devices are assigned to IoT Hub. There are four policies you can choose from:
- Evenly weighted distribution: The policy uses a weighted hash where all IoT hubs have the same weight assigned to them. You can adjust the weighted hash of a hub so that it gets more or fewer devices allocated to it.
- Lowest latency: Devices are assigned according to the shortest communication time with the IoT device.
- Static configuration: Devices are provisioned to a hub specified in the enrolment.
- Custom, using an Azure function: This option provides any type of policy in a function that uses a custom webhook that gets called when provisioning the device.
The default policy is Evenly weighted distribution. The following figure shows how to set the allocation policy in the portal:
Figure 3.4 – Setting the allocation policy
A common practice when working with IoT devices is the need...