page_type | languages | products | description | urlFragment | ||
---|---|---|---|---|---|---|
sample |
|
|
A sample project to show Event Grid module on Azure IoT Edge |
using-event-grid-publish |
This quick start demonstrates how to use publish/subscriber messaging pattern on edge using Event Grid. 3 modules are deployed as part of this quick start.
- Event Grid module - enables publish/subscriber messaging pattern on edge
- Publisher module - responsible for publishing events
- Subscriber module - responsible for receiving/handling events
Additionally with an Event Grid subscription to 'edgeHub' we can forward events to IoTHub via routes. Refer to Deployment template for details.
The module's device twin is used to create the topic and subscription used by the publisher and subscriber module. For simplicity, listens on HTTP and forwards to HTTP endpoint (Azure). Capable to restricting to only HTTPs on both incoming and outgoing. The URL depends on the module name. If deploying with a different name make sure to update the publisher module.
Responsible for publishing events to a topic with name 'quickstarttopic'. The topic is created in Event Grid module's device twin. Assumes Event Grid module is deployed with name 'eventgridmodule'. If done differently make sure to update the code appropriately.
Azure function is used to demonstrate how to write an event handler. The handler URL is registered as part of subscription creation. Any changes to the function URL needs to modify Event Grid device twin configuration as well.
- Open the top folder in VSCode (need Azure IoT Edge Extension)
- create or open a .env file and fill in the values (REGISTRY,USERNAME,PASSWORD)
- Now, you can build, push, deploy the solution
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.