1
0
Форкнуть 0
iot-central-bidirectional-d.../Samples/SampleTypeScriptAdapter
Pericles Alves 208c6139d1 Moving to persistent volumes & README improvements 2021-01-26 13:21:05 -08:00
..
src Initial commit 2021-01-15 14:35:13 -08:00
.dockerignore Initial commit 2021-01-15 14:35:13 -08:00
.gitignore Initial commit 2021-01-15 14:35:13 -08:00
Dockerfile Initial commit 2021-01-15 14:35:13 -08:00
README.md Moving to persistent volumes & README improvements 2021-01-26 13:21:05 -08:00
azuredeploy.json Moving to persistent volumes & README improvements 2021-01-26 13:21:05 -08:00
package.json Initial commit 2021-01-15 14:35:13 -08:00
tsconfig.json Initial commit 2021-01-15 14:35:13 -08:00

README.md

Sample adapter for the Device Bridge

This sample adapter written in TypeScript forwards D2C messages to an Event Hub. The code uses a client automatically generated by autorest using the Device Bridge swagger. Failures are logged in the same Log Analytics workspace used by the Bridge core module.

NOTE: this code should only be used as a sample reference for how to build adapters for the Device Bridge. It should not be used in a production setting without proper testing and error handling.

Deployment template

The template below is a modified version of the deployment template in the repository root to include the adapter container. It modifies the webserver configuration to route traffic to the adapter instead of the Bridge core module.

Deploy to Azure

APIs

Subscribe

POST /subscribe/{deviceId}

Creates a C2D message subscription for a device and forwards all C2D messages to an EventHub.

Unsubscribe

POST /unsubscribe/{deviceId}

Deletes the C2D message subscription for a device and stops publishing events.