iotc-migrator/device_samples
dependabot[bot] 538f4a1003
Bump xml2js and @azure/storage-blob in /device_samples/nodejs
Bumps [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) and [@azure/storage-blob](https://github.com/Azure/azure-sdk-for-js). These dependencies needed to be updated together.

Updates `xml2js` from 0.4.23 to 0.5.0
- [Release notes](https://github.com/Leonidas-from-XIV/node-xml2js/releases)
- [Commits](https://github.com/Leonidas-from-XIV/node-xml2js/commits/0.5.0)

Updates `@azure/storage-blob` from 12.12.0 to 12.13.0
- [Release notes](https://github.com/Azure/azure-sdk-for-js/releases)
- [Changelog](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/Changelog-for-next-generation.md)
- [Commits](https://github.com/Azure/azure-sdk-for-js/compare/@azure/storage-blob_12.12.0...@azure/storage-blob_12.13.0)

---
updated-dependencies:
- dependency-name: xml2js
  dependency-type: indirect
- dependency-name: "@azure/storage-blob"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-12 00:17:37 +00:00
..
dotnet adding dotnet 2022-12-05 16:48:17 +01:00
nodejs Bump xml2js and @azure/storage-blob in /device_samples/nodejs 2023-04-12 00:17:37 +00:00
python update readme 2022-12-05 17:07:53 +01:00
.gitignore adding dotnet 2022-12-05 16:48:17 +01:00
README.md update readme 2022-12-05 17:07:53 +01:00

README.md

Device Migration samples

This folder contains few code samples for devices receiving a new IdScope through the direct method configured in the Migration DTDL component. Each sample has the same functionalities (sends a simple telemetry in a loop and responds to the "DeviceMove" method) coded with a different language.

Run

  1. Create a ".env" file in this folder (it must be at the root of samples) with the following content:
DPS_ID_SCOPE=<ID_SCOPE>
DPS_DEVICE_ID=<DEVICE_ID>
DPS_DEVICE_KEY=<DEVICE_KEY>
  1. Run the required sample based on the language:
  • NodeJS

Javascript

cd nodejs
npm install
node javascript/device.js

Typescript

cd nodejs
npm install
npm run build
node dist/device.js
  • Python
cd python
pip install -r requirements.txt
python device.py
  • Dotnet
cd dotnet
dotnet restore
dotnet build
dotnet run