Giter VIP home page Giter VIP logo

iotc-migrator's Introduction

Azure IoT Central device migration tool

A companion experience that enables you to move devices between IoT Central applications and from/to Azure IoT Hub.

Requirements

  • An IoT Central application (or two if moving between applications)

    Go to IoT Central to create one.

  • An Azure Active Directory Application (AAD)

    Follow instructions here.

  • An IoT Hub instance (if migrating from/to Azure IoT Hub)

    Go to Azure Portal > IoT Hub to create one IoT Hub.

  • An Azure IoT Hub Device Provisioning Services (DPS) associated to the IoT Hub instance.

    Go to Azure Portal > DPS to create one DPS.

Setup

Create a file called .env in project root with following content after completed AAD creation steps above.

PORT=3002
REACT_APP_AAD_APP_CLIENT_ID=<your-AAD-Application-(client)-ID>
REACT_APP_AAD_APP_TENANT_ID=<your-AAD-Directory-(tenant)-ID>
REACT_APP_AAD_APP_REDIRECT_URI=http://localhost:3002

Make sure that the REACT_APP_AAD_APP_REDIRECT_URI in the config file and the Redirect URIs specified in your AAD Application are the same.

Model requirements

To successfully perform a migration from an IoT Central application, the template for the devices to be migrated must comply to a specific configuration. The easiest and quickest way to define required capabilities is to import the DeviceMigration component into the template.

You can find the json file here.

Follow instructions on IoT Central official documentation.

This repository contains few code samples showing how to handle the migration process from device side.

Run

You can run the tool in development mode using:

npm start
  • Open in the browser the AADRedirectURI url previously defined in your .env (by default is http://localhost:3002) to view it in the browser.

  • Authenticate the user.

Options

  1. IoT Central -> IoT Hub

Pick the needed values from source and target forms. Provide a name and click on Migrate button.

Follow instructions on the page to create a new enrollment group in the DPS instance then click on Start migration.

  1. IoT Central -> IoT Central

Pick the needed values from source and target forms. Optionally specify a target template to automatically assign migrating devices to a particular template in the application. Provide a name and click on Migrate button. Wait for the migration job to be configured. After that the job will automatically start and you can follow the progress in the Migration status page.

  1. IoT Hub -> IoT Central

Select the hubs from which migrating devices, provide a name and click on Migrate button. The job has been configured and available in the Migration status page. Once there click on "Run" and provide the required keys following instructions.

Wait for the job to complete.

Codebase

iotc-migrator is a React SPA application written in Typescript that runs 100% in the browser. It was bootstrapped with Create React App.

The project consume public Azure APIs on the latest stable versions.

The Authentication is performed using Microsoft Authentication Library (MSAL).

iotc-migrator's People

Contributors

codetunez avatar dependabot[bot] avatar lucadruda avatar microsoft-github-policy-service[bot] avatar vincenzocaruso avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iotc-migrator's Issues

"target should be string" error when trying to migrate

Got the error below when trying to migrate a basic test device from one IoT Central application to another:

The provided request body contains the following errors: target should be string.
You can contact support at https://aka.ms/iotcentral-support.
Please include the following information. Request ID: 1ch5htst, Time: Mon, 25 Apr 2022 07:37:47 GMT.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.