How to use own templates when creating an IoT Central Application

Kamp, Bastian 1 Reputation point
2024-05-27T13:52:31.5533333+00:00

Hey,

we are currently trying to create an IoT Central application using Terraform. We want to use a custom IoT Central app template. However, you can only specify the system templates and not the custom ones. The same applies to the Azure web UI. Only the system templates are available there as well, not the custom templates. It seems that you can only use the custom template via the shared link. Is that correct, or are we doing something wrong?

Best regards,
Basti

Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
358 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sander van de Velde | MVP 30,786 Reputation points MVP
    2024-05-27T18:47:48.2033333+00:00

    HelHHeello

    Hello @Kamp, Bastian,

    welcome to this moderated Azure community forum.

    I tried it myself via the Azure IoT Central portal:

    User's image

    I was able to create an app via the custom template:

    User's image

    This resulted in this app:

    User's image

    Please check this again in another browser or in an in-private browser.

    Also check if you logged in using the right email address and in the correct directory.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.


  2. Dom 1,631 Reputation points Microsoft Employee
    2024-05-28T10:54:51.8366667+00:00

    It is possible to use a customized template when you create a new IoT Central application using Terraform (or az cli, Arm template or bicep):

    1. Create your customized template by using the Template export option in the IoT Central application you want to use as your template.
    2. Make a note of the GUID at the end of the shareable URL link:User's image
    3. Use this GUID to construct a template ID to use in your Terraform configuration. Note the "@1.0.0" at the end:
    resource "azapi_resource" "testtemplate" {
      type = "Microsoft.IoTCentral/iotApps@2021-06-01"
      name = "mytemplatetest"
      location = "eastus"
      parent_id = azurerm_resource_group.qs101.id
      body = jsonencode({
        properties = {
          displayName = "Test template"
          subdomain = "mytesttemplating"
          template = "fc45eeb8-8d9a-4f11-00000000000000@1.0.0"
        }
        sku = {
          name = "ST2"
        }
      })
    }
    
    0 comments No comments