we want to deploy and configure an IoT Central with Infrastructure as Code (IaC). After creating the IoT-Central from a default template (iotc-pnp-preview@1.0.0) with pulumi, we get an IoT Central application without devices and without device templates. To automate the deployment further we want to configure the devices and device templates from a script, too. This is where we are facing some problems:
If we execute the commands from the tutorial (https://learn.microsoft.com/en-us/azure/iot-central/core/howto-manage-device-templates-with-rest-api) we get the following error:
{ "error": { "code": "NotFound", "message": ""undefined" is not a valid API version. You can contact support at https://aka.ms/iotcentral-support. Please include the following information. Request ID: 8uzlc76s, Time: Mon, 29 Nov 2021 12:48:21 GMT.", "requestId": "8uzlc76s", "time": "Mon, 29 Nov 2021 12:48:21 GMT" } }
Please note that other rest requests are working as expected. e.g. the Request to list all available device templates (https://learn.microsoft.com/en-us/rest/api/iotcentral/1.0dataplane/device-templates/get) returns:
{ "value": [] }
That's why we assume authentification and url are correct.
Can you tell me why my attempt to create a device template from rest interface fails? What do I need to do different to get it working?