This is currently not supported as per the API docs. https://learn.microsoft.com/en-us/python/api/azure-iot-device/azure.iot.device.provisioningdeviceclient?view=azure-python#azure-iot-device-provisioningdeviceclient-create-from-x509-certificate
Device register with multiple enrollment groups in the same DPS
Evandro Pomatti
11
Reputation points
I have a central IoT DPS with two enrollment groups:
- Enrollment group A is edge-enabled for IoT Edge devices / Gateway.
- Enrollment group B is edge-disabled for non-edge devices.
Both enrollment groups are assigned to use the same root CA certificate.
I can't find a way to "target" my device registrations to a specific enrollment group, either via code or via configuration.
For example, in the python code below for my non-edge device, it keeps going through the edge-enabled group, which is incorrect.
How can I select or filter which enrollment group will receive my. Do I need to use separate root CAs?
async def main():
x509 = X509(
cert_file=os.getenv("X509_CERT_FILE"),
key_file=os.getenv("X509_KEY_FILE"),
pass_phrase=os.getenv("X509_PASS_PHRASE"),
)
ProvisioningDeviceClient.create_from_x509_certificate
provisioning_device_client = ProvisioningDeviceClient.create_from_x509_certificate(
provisioning_host=provisioning_host,
registration_id=registration_id,
id_scope=id_scope,
x509=x509,
)
registration_result = await provisioning_device_client.register()