Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This is only supported in the current NIGHTLY version of Azure Injector (as of Feb 26, 2021). This will be made standard in the 3.4.0.7 12 release of Azure Injector.

...

Now browse to the Ignition Gateway Web UI and to the Azure Injector Settings and finally to the 'Azure IoT Hubs'. You should see the 'Test Setting' that was created in the prerequisite tutorial as shown below.

Image RemovedImage Added

Click the 'edit' button on the right for that setting to edit it. Then scroll down and click the 'Show advanced properties' checkbox near the bottom as shown below.

Image RemovedImage Added

Note the 'Content Type' and 'Content Encoding' fields. In order for Azure message routing to work, the 'Content Type' MUST be set to APPLICATION_JSON and the 'Content Encoding' should be set to UTF_8.

During the prerequisite tutorial a set of tags were created to publish to Azure IoT Hub. At this point, we will create some new tags that will be will be routed to the container based on the configuration that now exists in Azure. Because we created a message route that filtered on a Sparkplug Group ID of 'Routed Group' we should create a structure that includes this in the tag tree. Expanding on the tag tree created previously, add a new Sparkplug Group, Edge Node, and Device folder structure with a single boolean tag along side the original structure created in the quickstart as shown below. Note for the message route in Azure to work properly, the Group ID MUST be 'Routed Group' as shown below.

Image RemovedImage Added

Step 5: Publish Data to Azure IoT Hub

After creating this tag structure with the 'Routed Group', browse to the Azure Injector tag provider and write a 'true' to the 'Azure Injector Control/Refresh' tag shown below. This will cause Azure Injector to rescan the tag tree and publish messages to IoT Hub.

Image RemovedImage Added

Now that Azure Injector has scanned the tag tree, generate some tag change events by manually changing the following two tags. Make sure as you change these values you wait a couple of seconds between each change. This will ensure that a series of MQTT messages will be published to Azure IoT Hub.

...

Note that all of the messages shown here are from the 'Routed Group'. This is because of how the Azure IoT Hub message route was configured. The 'routing query' is looking for a 'groupId' of 'Routed Group'. So, all messages from the original 'Tutorial Group' were ignored and not routed to the container.

Additional Resources