iotedgedev | Azure IoT Edge Dev Tool greatly simplifies your Azure IoT | Azure library
kandi X-RAY | iotedgedev Summary
kandi X-RAY | iotedgedev Summary
For the absolute fastest way to get started with IoT Edge Dev, please see the Quickstart section below. For a more detailed overview of IoT Edge Dev Tool including setup and commands, please see the Wiki.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Load the environment variables
- Get an environment variable
- Sets the registry for the given env key
- Get the registry from the environment
- Decorate a function with telemetry
- Mark the result as failed
- Parse parameters
- Flush current session information
- Deploy a template
- Return ordered list of commands
- List resource groups
- Decorator to convert userags to telemetry
- Deploy an iothub
- Create a new solution
- Validate deployment template
- Invoke azure CLI
- List all available subscriptions
- Set up an IOLub
- Decorator to add module options
- Upload data to Telemetry server
- Decrypts the result of a function
- Start a simulation
- Remove a key from a dict
- Load the module json file
- Get the default IoT hub name
- Setup the configuration
iotedgedev Key Features
iotedgedev Examples and Code Snippets
Community Discussions
Trending Discussions on iotedgedev
QUESTION
I have an existing ASP.NET Core Web App running as a docker container and would like to provide it as a Edge Module running on Azure IoT Edge. From the docs i know i can run Azure Functions, Stream Analytics and Custom modules (which from my understanding are just console applications integrating with the Azure IoT Edge Runtime).
What is the best way to turn my ASP.NET Core Web App into an Edge Module and interact with Edge Hub?
Would the best approach be to use a custom module as a template, move my ASP.NET Core project over to fit the file structure and edit the dockerfiles to run my main ASP.NET Core Assembly?
Thank you for any advise!
Update: I was following the approach stated above. I created a custom edge module and tried to convert it to the simplest possible ASP.NET Core Web App using the following steps:
- Add package reference
Add Startup class
public class Startup {
...
ANSWER
Answered 2019-Jun-04 at 16:01If you app is already containerized, there shouldn't be really much that you need to add, to make this an Edge module:
- Add nuget package Microsoft.Azure.Devices.Client
Init ModuleClient somewhere in your code, probably in some startup routine:
ModuleClient moduleClient = await ModuleClient.CreateFromEnvironmentAsync(transportType);
Use the moduleClient to send and receive messages alongside your asp.net stuff
Add this container as a module in your deployment.json (and make it available in a container repo)
This should be pretty straightforward. You don't need to start from the module templates or Dockerfiles. If you look at them, there is really no magic going on.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install iotedgedev
Install Docker CE For Windows, please follow the document to open Docker Settings and setup a Shared Drive. For macOS, please follow the document to choose local directories to share with your containers. Note: If the device is behind the proxy server, you can set the proxy manually
Run the IoT Edge Dev Container Before you run the container, you will need to create a local folder to store your IoT Edge solution files. Windows mkdir c:\temp\iotedge docker run -ti -v /var/run/docker.sock:/var/run/docker.sock -v c:/temp/iotedge:/home/iotedge mcr.microsoft.com/iotedge/iotedgedev Linux sudo mkdir /home/iotedge sudo docker run -ti -v /var/run/docker.sock:/var/run/docker.sock -v ~/iotedge:/home/iotedge mcr.microsoft.com/iotedge/iotedgedev macOS mkdir ~/iotedge docker run -ti -v /var/run/docker.sock:/var/run/docker.sock -v ~/iotedge:/home/iotedge mcr.microsoft.com/iotedge/iotedgedev
Initialize IoT Edge solution and setup Azure resources iotedgedev init iotedgedev init will create a solution and setup your Azure IoT Hub in a single command. The solution comes with a default C# module named filtermodule. More information You will see structure of current folder like below: │ .env │ .gitignore │ deployment.debug.template.json │ deployment.template.json │ ├─.vscode │ launch.json │ └─modules └─filtermodule │ .gitignore │ Dockerfile.amd64 │ Dockerfile.amd64.debug │ Dockerfile.arm32v7 │ Dockerfile.windows-amd64 │ filtermodule.csproj │ module.json │ Program.cs Open .env file, you will see the IOTHUB_CONNECTION_STRING and DEVICE_CONNECTION_STRING environment variables filled correctly. Open deployment.template.json file You will see below section in the modules section: "filtermodule": { "version": "1.0", "type": "docker", "status": "running", "restartPolicy": "always", "settings": { "image": "${MODULES.filtermodule}", "createOptions": {} } } Two default routes are added: "routes": { "sensorTofiltermodule": "FROM /messages/modules/tempSensor/outputs/temperatureOutput INTO BrokeredEndpoint(\"/modules/filtermodule/inputs/input1\")", "filtermoduleToIoTHub": "FROM /messages/modules/filtermodule/outputs/* INTO $upstream" } You will see privacy statement like below: Welcome to iotedgedev! ------------------------- Telemetry --------- The iotedgedev collects usage data in order to improve your experience. The data is anonymous and does not include commandline argument values. The data is collected by Microsoft. You can change your telemetry settings by updating 'collect_telemetry' to 'no' in ~/.iotedgedev/setting.ini
Build IoT Edge module images sudo iotedgedev build This step will build user modules in deployment.template.json targeting amd64 platform. More information You will see a "BUILD COMPLETE" for each module and no error messages in the terminal output. Open config/deployment.amd64.json file, you will see the module image placeholders expanded correctly. Run sudo docker image ls, you will see the module images you just built.
Setup and start the IoT Edge Simulator to run the solution sudo iotedgedev start --setup --file config/deployment.amd64.json More information You will see an "IoT Edge Simulator has been started in solution mode." message at the end of the terminal output Run sudo docker ps, you will see your modules running as well as an edgeHubDev container
Monitor messages sent from IoT Edge Simulator to IoT Hub iotedgedev monitor More information You will see your expected messages sending to IoT Hub Stopping the monitor doesn't stop the simulator. It will continue running until it is explicitely stopped using iotedgedev stop and at that time all containers used by the simulator will be cleaned up.
Docker containers/images management The containers used by the simulator will be cleaned up when the simulator stops running iotedgedev stop All remaining containers can be cleaned up using iotedgedev docker clean -c All remaining images can be cleaned up using iotedgedev docker clean -i
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page