How to use a self signed certificate to publish messages on azure event grid namespace mqtt broker

Satyam Chauhan 607 Reputation points
2024-11-05T11:25:44.9166667+00:00

Hi,

I am trying to implement the the publish and subscribe functionality in a C# application, where I want to use a self signed certificate to authenticate the client, and then publish some data to the mqtt broker which can be received to all the subscribers.

To create the self signed certificate I used the openssl commands, which generated the root and intermediate certificates and the private key in pem format. I used the intermediate certificate to generate the thumbprint. the thumbprint is added in azure.

I am following this article - event-grid/mqtt-publish-and-subscribe-portal, instead of the MQTTX application I want to use a .NET app.

I am trying to create a c# application that can use the event grid namespace and the self signed certificates to authenticate and publish some dummy data.

Please provide some sample code that I can use to perform the publish operations. Or any article/documentation that can be helpful. Because the code that I am using is having lot of issues.

Thanks.

Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
407 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sander van de Velde | MVP 33,951 Reputation points MVP
    2024-11-05T15:50:06.1266667+00:00

    Hello @Satyam Chauhan,

    welcome to this moderated Azure community forum.

    I wrote a blog post where I used the Step CLI tool to generate the certificates.

    There is a sample C# application in that blog post, based on the Microsoft Sample library.

    An alternative C# application can be found in this blog post.

    Can you first try this out?

    If this is working, you can try out Open SSL.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.