This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = async function (context, req) { | |
| context.log('JavaScript HTTP trigger function processed a request.'); | |
| context.res = { | |
| status: 200, | |
| body: "Result message" | |
| }; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Reference to the Azure Storage SDK | |
| const azure = require('azure-storage'); | |
| // Reference to the uuid package which helps us to create | |
| // unique identifiers for our PartitionKey | |
| const uuid = require('uuid/v1'); | |
| // The TableService is used to send requests to the database | |
| const tableService = azure.createTableService(); | |
| // | |
| const tableName = "mytable"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const azure = require('azure-storage'); | |
| const tableService = azure.createTableService(); | |
| const tableName = "mytable"; | |
| module.exports = function (context, req) { | |
| context.log('Start ItemUpdate'); | |
| if (req.body) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const azure = require('azure-storage'); | |
| const tableService = azure.createTableService(); | |
| const tableName = "mytable"; | |
| module.exports = function (context, req) { | |
| context.log('Start ItemDelete'); | |
| const id = req.query.id; | |
| if (id) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| const Transport = require('azure-iot-device-mqtt').Mqtt; | |
| const ModuleClient = require('azure-iot-device').ModuleClient; | |
| const Message = require('azure-iot-device').Message; | |
| const DeviceClient = require('azure-iot-device').Client; | |
| let simulatedTemperatureClient; | |
| ModuleClient.fromEnvironment(Transport, function (err, moduleClient) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "modules": { | |
| "IdentityTranslationModule": { | |
| "version": "1.0", | |
| "type": "docker", | |
| "status": "running", | |
| "restartPolicy": "always", | |
| "settings": { | |
| "image": "${MODULES.IdentityTranslationModule}", | |
| "createOptions": {} | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "$edgeHub": { | |
| "properties.desired": { | |
| "schemaVersion": "1.0", | |
| "routes": { | |
| "IdentityTranslationModuleToIoTHub": "FROM /messages/modules/IdentityTranslationModule/outputs/* INTO $upstream", | |
| "sensorToIdentityTranslationModule": "FROM /messages/modules/SimulatedTemperatureSensor/outputs/temperatureOutput INTO BrokeredEndpoint(\"/modules/IdentityTranslationModule/inputs/input1\")" | |
| }, | |
| "storeAndForwardConfiguration": { | |
| "timeToLiveSecs": 7200 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$schema-template": "2.0.0", | |
| "modulesContent": { | |
| "$edgeAgent": { | |
| "properties.desired": { | |
| "schemaVersion": "1.0", | |
| "runtime": { | |
| "type": "docker", | |
| "settings": { | |
| "minDockerVersion": "v1.25", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "modules": { | |
| "BLEModule": { | |
| "version": "1.0", | |
| "type": "docker", | |
| "status": "running", | |
| "restartPolicy": "always", | |
| "settings": { | |
| "image": "${MODULES.BLEModule}", | |
| "createOptions": { | |
| "NetworkingConfig": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Client.fromEnvironment(Transport, function (err, client) { | |
| if (err) { | |
| throw err; | |
| } else { | |
| client.on('error', function (err) { | |
| throw err; | |
| }); | |
| // connect to the Edge instance | |
| client.open(function (err) { |