How-to
Publish select tags over MQTT to cut Azure message costs
Short answer
Azure counts every message the transmitter publishes, and a Sparkplug topic subscription cannot select individual tags, so filtering on the receiving side bills every message anyway. Build a dedicated publish tag provider whose UDT instances bind a source-path parameter back to the SCADA provider, scope the transmitter to that provider alone, and deadband the members IT reports on.

On this page
The Azure end of this path bills by message count, and the count is fixed at the moment the transmitter publishes. A Sparkplug B topic subscription cannot select individual tags: its filters match the group, message type, edge node and device levels of the topic, and every metric rides inside the payload below them. Receiving-side selection therefore bills every published message anyway, however neatly the subscription is scoped. The cut has to happen at the first publish hop: build a small publish tag provider whose UDT instances point back at the SCADA provider through a source-path parameter, scope the transmitter to that provider alone, and deadband the members the IT department reports on. The steps below build that in order, with a check after each stage and a before-and-after count at the end.
Where the message count is decided #
The path is the full SCADA tag provider on the SCADA gateway, the IIoT gateway running the MQTT Transmission transmitter, and the Azure injector feeding the data warehouse. The SCADA provider holds several thousand tags and the Azure end is charged per message, so every birth message and every change-driven data message in scope becomes a line on the bill. Each hop either fixes that set or only carries it:
| Hop | What crosses it | Can it cut the bill? |
|---|---|---|
| Tag provider to transmitter | The tag scope you select | Yes, the only hop that decides the set |
| Transmitter and injector to Azure | Birth messages, then change-driven data | No, everything in scope is already on the wire |
| Subscription at the receiving side | The same messages | Not by tag, topic levels stop at the device |
| Azure ingestion | Billed messages | No, the count lands here |
The subscription row is the trap. The Sparkplug B specification puts only the group, the message type, the edge node and an optional device into the topic, and everything else lives in the payload, so a filter such as spBv1.0/PlantA/DBIRTH/# selects whole groups or whole edge nodes and never individual metrics. The namespace stops three levels above the payload by design, a limit detailed in Understanding the Sparkplug three-level topic namespace. An edge node carrying 10 tags publishes all 10 even when the report uses 3.
Decision: when the destination charges per message, the transmitter's tag scope is the only lever that reaches the bill. Record the baseline before changing anything, meaning the message count over a fixed window, for example one hour, from the broker statistics or the Azure metrics; every later comparison uses that same window.
Build a publish provider that mirrors only the reported tags #
One reference tag per source tag would work, but it loses the UDT structure and costs a hand-built tag for every reported item. A dedicated publish provider of parameterized UDT instances keeps the structure and scales by script. Build it on the gateway that hosts the transmitter:
- Get the IT department's required tag list in writing. That list, not the SCADA provider's folder layout, defines what the publish provider contains.
- Create a new tag provider on that gateway and name it for its purpose, so nobody drops engineering tags into it later.
- Copy the UDT definitions behind the reported equipment into it, and trim each definition to the members the reports actually use. Fewer members means fewer changing metrics and fewer messages.
- Add a UDT parameter that holds the source tag path of each instance, and bind every member's value source to that parameter through a reference or expression binding. Which value-source types a UDT member accepts varies by gateway version, so confirm it there first. Where the SCADA tags live on another gateway, the parameter's path resolves through a remote tag provider.
- Instantiate one UDT instance per equipment item on the list. For more than a handful, generate them with a bulk JSON tag import or a short script that reads the list and writes each instance with its parameter filled in.
- Check by browsing the publish provider: every instance must show its full member set with good quality and values matching the SCADA source. A bad-quality member is a wrong parameter path, and it is fixed here, because a broken path publishes its own quality change as a message.
Scope the transmitter to the publish provider #
Open the transmitter's configuration and restrict its tag scope to the publish provider, or to one folder inside it. If the transmitter currently publishes the SCADA provider, that provider has to leave the scope before cutover; leaving both in publishes both sets and the count rises instead of falling.
Subscribe a diagnostic MQTT client at the broker the transmitter publishes through, for the birth filter of the group ID it is configured with, for example spBv1.0/PlantA/DBIRTH/#. A birth message lists every metric the node publishes, so the check is direct: the metric list in the birth must equal the publish provider's contents and nothing more. Any metric that traces back to the SCADA provider means the scope was not narrowed.
Decision: hold the cutover until the birth list matches the IT department's list exactly.
Deadband the members that churn #
Sparkplug data messages are change-driven: a member transmits when its value changes, so the count follows the change rate, not the tag count alone. A noisy analog without a deadband transmits on nearly every scan.
Worked example with illustrative numbers: one tank-level member is scanned for changes every second and the report reads it in whole percent. Without a deadband, jitter moves the reading on almost every scan, so that one member can send 1 message per second across a 3,600-second hour, which is 3,600 messages. A 1% deadband transmits only when the reading moves a full percent. On a 60-minute ramp from 20% to 80% the reading crosses 60 deadband steps, so the member sends 60 messages that hour, and on a flat level it sends none. That member's hourly count falls from 3,600 to 60, a 60-fold cut, before a single tag leaves the set.
Remove members the reports never query, particularly counters and timers that move every second; each one is a permanent message stream of its own.
Keep rebirths rare: a rebirth republishes every metric in scope, and the burst is billed like any other traffic. When to use the Sparkplug rebirth tag on an edge node covers what a rebirth is for. If a receiving Ignition gateway also consumes this namespace, do not store history on the folder tags an MQTT provider creates there, because they are deleted and recreated at each rebirth; getting backfilled Sparkplug history through Ignition reference tags shows the reference-tag route that survives a rebirth.
Check: watch the diagnostic client for a few minutes at a steady process state, find the members that change most often, deadband those first, and re-watch until the rate is flat.
Verify the count and the data end to end #
- Compare the message count over the same fixed window used for the baseline. The new count must sit below the old one by roughly the share of removed tags and deadbanded members; a count that barely moved means churn is still in scope.
- Check the data warehouse tables for the selected equipment: values current, timestamps advancing, and no gap after a gateway restart.
- Force one rebirth in a maintenance window and confirm the burst carries only the reduced metric set.
- Add one new instance to the publish provider the way the next tag request would arrive, and confirm it reaches Azure with no change at the injector or on the Azure side.
Decision: cut over when the birth list matches the IT department's list, the window count has fallen in proportion to what was removed, and the values land current in the warehouse. If any SCADA-provider metric still appears in a birth message, the scope was not narrowed, and no subscription change at the Azure end will shrink the bill.
Questions asked
Why not just point the transmitter at a sub-folder of the SCADA provider?
A sub-folder keeps the UDT structure and takes little work, but it only cuts the count when the folder happens to match the report. Providers organized by area or controller still carry many tags the reports never query. The parameterized publish provider cuts reliably because its contents come from the report list, not from the folder layout.
Should the deadband sit on the SCADA source tag or on the publish-provider member?
Either works and the choice is operational. A deadband on the SCADA source tag quiets the value for every consumer, including local displays, so apply it only where the process tolerates it. A deadband on the publish-provider member quiets only the reported value and leaves the source untouched, which is the safer default when the SCADA side still needs raw resolution.
IT asks for another tag after cutover. What has to change?
Add one more instance of the same UDT definition to the publish provider and fill in its source-path parameter. The transmitter includes the new member at its next birth, and nothing changes on the injector or the Azure side. Remove an instance the same way when a report drops a tag, and the count falls with the next birth.
Can internal SCADA consumers and Azure share one transmitter?
Give each its own transmitter instance and its own scope: the full SCADA provider on one, the publish provider on the other, with distinct group or edge node identities so their topic sets never overlap. Changing the Azure scope then never disturbs the internal feed, and each side can be rebirthed without touching the other.
Is there a tag count above which this path stops making sense?
The cost follows change events, not tag count, because MQTT was built for compact, change-driven traffic. A few hundred slow-changing tags can bill less than a handful of noisy ones, so size the publish set from the baseline window's message count rather than from the number of tags, and grow it by report need.

