0

I am using C# and using the Microsoft.Azure.Devices.Provisioning.ClientProvisioningDeviceClient SDK and trying to set displayName during the call to RegisterAsync(ProvisioningRegistrationAdditionalData, CancellationToken).

I have:

        var pnpPayload = new ProvisioningRegistrationAdditionalData
        {
            JsonData = $"{{ \"modelId\": \"{parameters.ModelId}\", \"displayName\": \"{parameters.DeviceName}\" }}",
        };

        return await pdc.RegisterAsync(pnpPayload, cancellationToken);

and the JsonData is:

"{ \"modelId\": \"dtmi:iotDevicesAnywhere:MfrAIUTModelIAA5Level_3o3;1\", \"displayName\": \"Test Device 1 - I90\" }" 

but it is not setting the display name. What should be the structure of the JSON Data be?

Mike Lenart
  • 767
  • 1
  • 5
  • 19
  • 1
    I am not sure if there is way to set displayName through Azure IoT DPS. The Device Provisioning service connects to Azure IoT Hub on the back end. There is no provision to set displayName in Azure IoT Hub. Only Azure IoT Central has a concept for displayName. Can you provide a resource on where you might have encountered the concept of displayName on Azure IoT Hub – LeelaRajesh_Sayana Oct 31 '22 at 17:45
  • @LeelaRajesh_Sayana I don’t know of a concept in IoT Hub. – Mike Lenart Nov 01 '22 at 22:58
  • The device Id paramter of dps is the device name which can be shown in Azure IoT after the enrolled dps device provisioned. There is no such as additional property. I dont know the exact use case but you can set additional custom properties in the device twin tag section – vithal wadje Feb 06 '23 at 16:16

0 Answers0