Skip to content

iot-for-all/iotc-solution-migrator

Repository files navigation

Azure IoT Central to PaaS migration tool

A simple, managed solution to move your IoT Central devices to a platform service powered by Azure resources and Grafana Dashboards.

Telemetry

Requirements

  1. Azure Subscription
  2. Azure IoT Central application and API Key
  3. Compatible IoT Central device templates (see Prepare IoT Central Application and devices).

What resources will be deployed

  • Azure IoT Hub (Standard SKU)
  • Azure IoT Hub Provisioning Service (Standard SKU)
  • Azure Function (Consumption mode)
  • Azure SQL Server (Serverless mode)
  • Azure Storage Account

Limitations

  • Currently the tool does not support migration of devices authenticating through x509 certificates but SAS keys only.
  • The whole tool is based on the concept of "device template". Unassigned devices are currently not supported.
  • Dashboard customizations in the IoT Central application are not automatically applied to grafana dashboards.

1. Fetch details.

In order to automate the migration process, the tool utilizes IoT Central API tokens to interact with an application. Please create an API token or reuse an existing one with "App Administrator" role.

Follow official instructions on how to create an API token in IoT Central here.

Also note down the application subdomain, you can find it under the "Application" page in the IoT Central application.

2. Create resources

This repository contains an automated script which creates and configures all required Azure resources in one click. Hit the "Deploy to Azure" button below to start provision the tool. Give project a name to be used as a prefix for all resource names and both application subdomain and API token as detailed in previous step. Once deployment ends, go to the "Outputs" section and copy the new scopeId to be used later in the setup.

Deploy to Azure

3. Access dashboards.

User designed to be the dashboards administrator must be granted with the "Grafana Admin" role. Open the resource group in Azure portal and add the role by searching for "Grafana admin" and assign it to the user.

Roles may take up to an hour to propagate. Read Dashboard instructions to access Grafana portal and manage users and organizations.

4. Start device migration

When you are ready to migrate your running devices create a Job in the IoT Central application. Open "Jobs->Create new job", give it a name, an optional description and select the target devices. IoT Central automatically creates device groups including all devices of specific templates. To work on a subset of devices, create your own groups. Define the job properties like this:

Job Type = 'Command'
Command = 'DeviceMove'
Data->Id Scope = '[scopeId]'  // scopeId as shown in the deployment output


Prepare IoT Central Application and devices.

This migration tool assumes the device templates in the application include the "Device Migration" component. You can download the DTDL component schema from here.

The device firmware must react to the "DeviceMove" command defined in the component above. A python sample is available in the device-sample folder.

About

Migration from IoTC to IoT Hub with solution

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published