You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-central/core/howto-version-device-template.md
+79-20Lines changed: 79 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Understanding device template versioning for your Azure IoT Central apps
3
3
description: Iterate over your device templates by creating new versions and without impacting your live connected devices
4
4
author: sarahhubbard
5
5
ms.author: sahubbar
6
-
ms.date: 12/09/2019
6
+
ms.date: 04/24/2020
7
7
ms.topic: how-to
8
8
ms.service: iot-central
9
9
services: iot-central
@@ -14,58 +14,117 @@ manager: peterpr
14
14
15
15
*This article applies to solution builders and device developers.*
16
16
17
-
Azure IoT Central allows rapid development of IoT Applications. You can quickly iterate over your device template designs by adding, editing, or deleting device capabilities, views, and customizations. Once you have published your device template, the device capability model shows as **Published** with lock icons next to the model. In order to make changes to the device capability model, you will need to create a new version of the device template. Meanwhile the cloud properties, customizations, and views can all be edited at any time without needing to version the device template. Once you have saved any of these changes, you can publish the device template to make the latest changes available for the operator to view in Device Explorer.
17
+
A device template includes a schema that describes how a device interacts with IoT Central. These interactions include telemetry, properties, and commands. Both the device and the IoT Central application rely on a shared understanding of this schema to exchange information. You can only make limited changes to the schema without breaking the contract, that's why most schema changes require a new version of the device template. Versioning the device template lets older devices continue with the schema version they understand, while newer or updated devices use a later schema version.
18
+
19
+
The schema in a device template is defined in the device capability model (DCM) and its interfaces. Device templates include other information, such as cloud properties, display customizations, and views. If you make changes to those parts of the device template that don't define how the device exchanges data with IoT Central, you don't need to version the template.
20
+
21
+
You must publish any device template changes, whether or not they require a version update, before an operator can use it. IoT Central stops you from publishing breaking changes to a device template without first versioning the template.
18
22
19
23
> [!NOTE]
20
24
> To learn more about how to create a device template see [Set up and manage a device template](howto-set-up-template.md)
21
25
22
-
## Add customizations to the device template without versioning
26
+
## Versioning rules
27
+
28
+
This section summarizes the versioning rules that apply to device templates. Both DCMs and interfaces have version numbers. The following snippet shows the DCM for an environmental sensor device. The DCM has two interfaces: **DeviceInformation** and **EnvironmentalSensor**. You can see the version numbers at the end of the`@id` fields. To view this information in the IoT Central UI, select **View identity** in the device template editor.
* After a DCM is published, you can't remove any interfaces, even in a new version of the device template.
74
+
* After a DCM is published, you can add an interface if you create a new version of the device template.
75
+
* After a DCM is published, you can replace an interface with a newer version if you create a new version of the device template. For example, if the sensor v1 device template uses the EnvironmentalSensor v1 interface, you can create a sensor v2 device template that uses the EnvironmentalSensor v2 interface.
76
+
* After an interface is published, you can't remove any of the interface contents, even in a new version of the device template.
77
+
* After an interface is published, you can add items to the contents of an interface if you create a new version of the interface and device template. Items that you can add to the interface include telemetry, properties, and commands.
78
+
* After an interface is published, you can make non-schema changes to existing items in the interface if you create a new version of the interface and device template. Non-schema parts of an interface item include the display name and the semantic type. The schema parts of an interface item that you can't change are name, capability type, and schema.
79
+
80
+
The following sections walk you through some examples of modifying device templates in IoT Central.
81
+
82
+
## Customize the device template without versioning
23
83
24
84
Certain elements of your device capabilities can be edited without needing to version your device template and interfaces. For example, some of these fields include display name, semantic type, minimum value, maximum value, decimal places, color, unit, display unit, comment, and description. To add one of these customizations:
25
85
26
86
1. Go to the **Device Templates** page.
27
87
1. Select the device template you wish to customize.
28
88
1. Choose the **Customize** tab.
29
-
1. All of the capabilities defined in your device capability model will be listed here. All of the fields you can edit here can be saved and used across your application, without needing to version your device template. If there are fields you wish to edit that are read-only, you will need to version your device template to change these. Select a field you wish to edit and enter in any new values.
30
-
1. Click **Save**. Now these values will override anything that was initially saved in your device template and will be used across the application.
89
+
1. All the capabilities defined in your device capability model are listed here. You can edit, save, and use all of these fields without the need to version your device template. If there are fields you wish to edit that are read-only, you must version your device template to change them. Select a field you wish to edit and enter in any new values.
90
+
1. Click **Save**. Now these values override anything that was initially saved in your device template and are used across the application.
31
91
32
-
## Versioning a device template
92
+
## Version a device template
33
93
34
-
Creating a new version of your device template will create a draft version of the template where the device capability model can be edited. Any published interfaces will remain published until they are individually versioned. In order to modify a published interface, you must first create a new device template version.
94
+
Creating a new version of your device template creates a draft version of the template where the device capability model can be edited. Any published interfaces remain published until they're individually versioned. To modify a published interface, first create a new device template version.
35
95
36
-
The device template should only be versioned when you are trying to edit a part of the device capability model that you can not edit in the customizations section of the device template.
96
+
Only version the device template when you're trying to edit a part of the device capability model that you can't edit in the customizations section.
37
97
38
-
In order to version a device template:
98
+
To version a device template:
39
99
40
100
1. Go to the **Device Templates** page.
41
-
1. Select the device template you are trying to version.
42
-
1. Click the **Version** button at the top of the page and give the template a new name. We have suggested a new name for you which can be edited.
101
+
1. Select the device template you're trying to version.
102
+
1. Click the **Version** button at the top of the page and give the template a new name. IoT Central suggests a new name, which you can edit.
43
103
1. Click **Create**.
44
-
1. Now your device template is in draft mode. You will see your interfaces are still locked and must be individually versioned to be edited.
104
+
1. Now your device template is in draft mode. You can see your interfaces are still locked. Version any interfaces you want to modify.
45
105
46
-
### Versioning an interface
106
+
##Version an interface
47
107
48
-
Versioning an interface allows you to add, update, and remove the capabilities inside the interface you had already created.
108
+
Versioning an interface allows you to add, update, and remove the capabilities inside the interface you had already created.
49
109
50
-
In order to version an interface:
110
+
To version an interface:
51
111
52
112
1. Go to the **Device Templates** page.
53
113
1. Select the device template you have in a draft mode.
54
114
1. Select the interface that is in published mode that you wish to version and edit.
55
-
1. Click the **Version** button at the top of the interface page.
115
+
1. Click the **Version** button at the top of the interface page.
56
116
1. Click **Create**.
57
-
1. Now your interface is in draft mode. You will be able to add or edit capabilities to your interface without breaking existing customizations and views.
117
+
1. Now your interface is in draft mode. You can add or edit capabilities to your interface without breaking existing customizations and views.
58
118
59
119
> [!NOTE]
60
120
> Standard interfaces published by Azure IoT can not be versioned or edited. These standard interfaces are used for device certification.
61
121
62
122
> [!NOTE]
63
123
> Once the interface has been published, you can not delete any of it's capabilities even in a draft mode. Capabilities can only be edited or added to the interface in draft mode.
64
124
125
+
## Migrate a device across versions
65
126
66
-
## Migrate a device across device template versions
67
-
68
-
You can create multiple versions of the device template. Over time, you will have multiple connected devices using these device templates. You can migrate devices from one version of your device template to another. The following steps describe how to migrate a device:
127
+
You can create multiple versions of the device template. Over time, you'll have multiple connected devices using these device templates. You can migrate devices from one version of your device template to another. The following steps describe how to migrate a device:
69
128
70
129
1. Go to the **Device Explorer** page.
71
130
1. Select the device you need to migrate to another version.
0 commit comments