Elastacloud.TwinMigration 0.0.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global Elastacloud.TwinMigration --version 0.0.0.1
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local Elastacloud.TwinMigration --version 0.0.0.1
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Elastacloud.TwinMigration&version=0.0.0.1
nuke :add-package Elastacloud.TwinMigration --version 0.0.0.1

Introduction

An SDK wrapper around Azure Digital Twins SDK that provides additional best practices around versioning, query helpers, fluent access to creation.

Versioning

Digital Twin instances are typed. These types are described by DTDL models which can be versioned. You should keep your DTDL in JSON files, git control them and then target a deployment in an automated way.

The main challenges facing us with Versioning are:

  • How do we keep digital twin instance matching the desired version of the DTDL model?
    • We may want migrate digital twin instances to new versions of DTDL models over time or there may be a migration process, such as adding a value for a new property
  • When working with digital twin instances in client code (e.g. C#) how do we map the digital twin instance to the appropriate POCO? (Or, perhaps, is there one POCO that subsumes all versions?)

This repo provides a dotnet tool, a Global Tool to assist in the validation and deployment of Azure Digital Twin models. It has multiple modes, as described below.

Installation

dotnet tool install twinmigration

Validation

Purpose: To generate Markdown compatible tables of DTDL compliance between a source input path and a target ADT.

You can execute it in a number of ways:

  1. Source Input Files to Target ADT - allows you to ask "what is deployed that is different to my local DTML?"
  2. Source Input Files to Target Input Files - allows you to ask "what is different two sets of DTDL files held locally?"
  3. Source ADT to Target ADT - allows you to ask "what is deployed differently between these ADT instances?"
  4. Source ADT to Target Input Files - allows you to ask "what is different from the deployment to my local DTML?"

Usage

twinmigration validate --source-input-path C:\DTDL\Latest --target-twin-instance https://[myTwinInstance].api.weu.digitaltwins.azure.net

Example Output

ModelValidated Success Message
dtmi:digitaltwins:rec_3_3:core:Agent;2 False The model dtmi:digitaltwins:rec_3_3:core:Agent;2 isn't in the target environment
dtmi:digitaltwins:rec_3_3:core:Asset;1 False The model dtmi:digitaltwins:rec_3_3:core:Asset;1 isn't in the target environment
dtmi:digitaltwins:rec_3_3:core:BuildingComponent;1 False The model dtmi:digitaltwins:rec_3_3:core:BuildingComponent;1 isn't in the target environment

Deployment

twinmigration deploy --source-input-path C:\DTDL\Latest --target-twin-instance https://[myTwinInstance].api.weu.digitaltwins.azure.net

This will take all the Models defined in the --source-input-path and apply them to the target instance.

Available flags:

  • -f --force will skip local validation code and attempt the full deployment
  • -c --strict will cause local validation to fail if there is a version update that skips a version, for example from dtmi:elastacloud:code;1 to dtmi:elastacloud:code;3.

Decommission

twinmigration decommission --target-twin-instance https://[myTwinInstance].api.weu.digitaltwins.azure.net

This will take all the Models defined in the target Azure Digital Twin and will decommission it, if there is a later version of the model available. This means we can deploy new models, have runtime code still able to target old models while the runtime code is being updated, and then have the old models decommissioned when the runtime code has been replaced.

Available Flags:

  • -o --tolerance default 1, controls how many versions out of date a model must be before it is selected for decommissioning. For instance if dtmi:elastacloud:code;4 exists and running with tolerance of 2 will decommission dtmi:elastacloud:code;1 and dtmi:elastacloud:code;2

Query Helpers

This repo provides a dotnet package to assist in the runtime management of these versions, to provide a POCO for acting as a container for the instance data, and validating POCOs against deployed DTDL instances.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
3.1.8 92 4/26/2024
3.1.7 157 2/5/2024
3.1.6 135 2/1/2024
3.1.5 151 1/31/2024
3.1.4 172 6/12/2023
3.1.2 321 11/22/2022
3.1.1 321 10/5/2022
3.0.12 415 7/28/2022
3.0.11 399 7/20/2022
3.0.10 430 6/10/2022
3.0.9 421 6/9/2022
3.0.8 425 4/28/2022
3.0.7 409 4/27/2022
3.0.6 418 4/26/2022
3.0.5 446 4/21/2022
3.0.4 404 4/14/2022
3.0.3 428 4/14/2022
3.0.2 424 4/14/2022
2.0.15 434 3/25/2022
2.0.14 419 3/21/2022
2.0.13 442 2/24/2022
2.0.12 426 2/14/2022
2.0.11 417 2/3/2022
2.0.1 268 1/5/2022
1.0.61 292 11/16/2021
1.0.60 375 11/9/2021
1.0.59 337 11/4/2021
1.0.58 329 10/29/2021
1.0.57 317 10/27/2021
1.0.56 432 9/27/2021
1.0.55 361 9/7/2021
1.0.54 369 7/29/2021
1.0.53 351 7/29/2021
1.0.52 343 7/28/2021
1.0.51 310 7/6/2021
1.0.50 402 7/1/2021
1.0.49 366 7/1/2021
1.0.48 344 6/28/2021
1.0.47 309 5/5/2021
1.0.46 318 5/5/2021
1.0.45 331 5/4/2021
1.0.44 320 5/4/2021
1.0.43 338 4/26/2021
1.0.42 359 4/23/2021
1.0.41 342 4/23/2021
1.0.40 336 4/23/2021
1.0.39 318 4/23/2021
1.0.38 310 4/23/2021
1.0.37 327 4/23/2021
1.0.36 340 4/23/2021
1.0.33 341 4/21/2021
1.0.32 301 4/21/2021
1.0.31 317 4/21/2021
1.0.30 371 4/19/2021
1.0.29 363 4/19/2021
1.0.28 346 4/16/2021
1.0.27 375 4/16/2021
1.0.25 346 4/15/2021
1.0.24 359 4/14/2021
1.0.23 369 4/14/2021
1.0.22 331 4/14/2021
1.0.21 319 4/14/2021
1.0.20 326 4/13/2021
1.0.17 323 4/12/2021
1.0.16 325 4/12/2021
1.0.15 366 4/10/2021
1.0.14 343 4/10/2021
1.0.13 358 4/9/2021
1.0.12 326 4/9/2021
0.0.1 398 4/9/2021
0.0.0.1 362 4/9/2021