Hi Colin McClure,
Thank you for posting your question in the Microsoft Q&A forum
The issue where your real publisher IoT device and .NET subscriber cannot connect to the Azure Event Grid MQTT broker with Sparkplug B support, despite test clients working fine, likely involves differences in certificate handling, TLS handshake, and MQTT CONNECT authorization specifics on the Azure side.
Common causes and insights:
- Certificate Format and Chain:
The test clients like MQTTX and MQTT Explorer may be more lenient or automatically handle certificate chains and formats.
Your IoT device and .NET app require proper PFX format with the entire certificate chain included (CA + intermediate + client cert + private key).
Converting PEM to PFX must include the full chain and private key; any missing link or mismatch can cause authorization failures or connection timeouts.
Test clients are often more tolerant or automate cert handling while production IoT devices and .NET apps require exact certificate chain formatting, thumbprint matching, and supported network/TLS configurations. Troubleshooting involves ensuring PFX correctness, matching thumbprints, network setup, and checking Azure Event Grid logs.
Reference
Support for Sparkplug B in Azure Event Grid MQTT Broker - Azure Event Grid | Microsoft Learn
MQTT (PubSub) Broker - Azure Event Grid | Microsoft Learn
I hope the provided answer is helpful,
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.
Thank you.