You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/event-grid/mqtt-publish-and-subscribe-portal.md
+10-21Lines changed: 10 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,32 +1,23 @@
1
1
---
2
-
title: 'Quickstart: Publish and subscribe on an MQTT topic using portal'
2
+
title: Publish and subscribe on an MQTT topic using portal
3
3
description: 'Quickstart guide to use Azure Event Grid’s MQTT broker feature and Azure portal to publish and subscribe MQTT messages on a topic.'
4
4
ms.topic: quickstart
5
-
ms.custom:
6
-
- build-2023
7
-
- ignite-2023
8
-
ms.date: 11/15/2023
5
+
ms.date: 12/13/2024
9
6
author: george-guirguis
10
7
ms.author: geguirgu
11
8
ms.subservice: mqtt
9
+
# Customer intent: I want to know how to publish and subscribe to an Azure Event Grid MQTT topic using Azure portal.
12
10
---
13
11
14
12
# Quickstart: Publish and subscribe to MQTT messages on Event Grid Namespace with Azure portal
15
-
16
-
In this article, you use the Azure portal to do the following tasks:
17
-
18
-
1. Create an Event Grid namespace and enable MQTT broker
19
-
2. Create sub resources such as clients, client groups, and topic spaces
20
-
3. Grant clients access to publish and subscribe to topic spaces
21
-
4. Publish and receive messages between clients
22
-
13
+
In this quickstart, you use the Azure portal to create an Event Grid namespace with MQTT broker enabled, create sub resources such as clients, client groups, and topic spaces, grant clients access to publish and subscribe to topic spaces, and then publish and receive messages between clients.
23
14
24
15
25
16
## Prerequisites
26
17
27
18
- Create an [Azure free account](https://azure.microsoft.com/free/) If you don't have an Azure subscription.
28
19
- Read through [Event Grid overview](overview.md) before starting this tutorial, if you're new to Azure Event Grid.
29
-
- Ensure that port 8883 is open in your firewall. The sample in this tutorial uses the MQTT protocol, which communicates over port 8883. This port may be blocked in some corporate and educational network environments.
20
+
- Ensure that port 8883 is open in your firewall. The sample in this tutorial uses the MQTT protocol, which communicates over port 8883. This port might be blocked in some corporate and educational network environments.
30
21
- You need an X.509 client certificate to generate the thumbprint and authenticate the client connection.
31
22
32
23
## Generate sample client certificate and thumbprint
@@ -98,11 +89,11 @@ After a successful installation of Step, you should open a command prompt in you
98
89
1. Client authentication name is defaulted to the client name. For this tutorial, change it to `client1-authn-ID`. You need to include this name as `Username` in the CONNECT packet.
99
90
1. In this tutorial, you use thumbprint based authentication. Include the first client certificate’s thumbprint in the **Primary Thumbprint**.
100
91
101
-
:::image type="content" source="./media/mqtt-publish-and-subscribe-portal/mqtt-client1-metadata.png" alt-text="Screenshot of client 1 configuration.":::
92
+
:::image type="content" source="./media/mqtt-publish-and-subscribe-portal/mqtt-client1-metadata.png" alt-text="Screenshot of the configuration of client 1.":::
102
93
6. Select **Create** on the toolbar to create another client.
103
94
7. Repeat the above steps to create a second client named `client2`. Change the authentication name to `client2-authn-ID` and include the **second** client certificate’s thumbprint in the **Primary Thumbprint**.
104
95
105
-
:::image type="content" source="./media/mqtt-publish-and-subscribe-portal/mqtt-client2-metadata.png" alt-text="Screenshot of client 2 configuration.":::
96
+
:::image type="content" source="./media/mqtt-publish-and-subscribe-portal/mqtt-client2-metadata.png" alt-text="Screenshot of the configuration of client 2.":::
106
97
107
98
> [!NOTE]
108
99
> - To keep the QuickStart simple, you'll be using Thumbprint match for authentication. For detailed steps on using X.509 CA certificate chain for client authentication, see [client authentication using certificate chain](./mqtt-certificate-chain-client-authentication.md).
@@ -115,7 +106,6 @@ After a successful installation of Step, you should open a command prompt in you
115
106
116
107
:::image type="content" source="./media/mqtt-publish-and-subscribe-portal/create-topic-space-menu.png" alt-text="Screenshot of Topic spaces page with create button selected." lightbox="./media/mqtt-publish-and-subscribe-portal/create-topic-space-menu.png":::
117
108
1. Provide a **name** for the topic space, on the **Create topic space** page.
118
-
1. Select **+ Add topic template**.
119
109
120
110
:::image type="content" source="./media/mqtt-publish-and-subscribe-portal/create-topic-space-name.png" alt-text="Screenshot of Create topic space with the name.":::
121
111
1. Enter `contosotopics/topic1` for the topic template, and then select **Create** to create the topic space.
@@ -145,8 +135,7 @@ After a successful installation of Step, you should open a command prompt in you
145
135
## Connecting the clients to the EG Namespace using MQTTX app
146
136
147
137
1. For publish / subscribe MQTT messages, you can use any of your favorite tools. For demonstration purpose, publish / subscribe is shown using MQTTX app, which can be downloaded from https://mqttx.app/.
148
-
149
-
:::image type="content" source="./media/mqtt-publish-and-subscribe-portal/mqttx-app-add-client.png" alt-text="Screenshot showing MQTTX app left rail to add new client.":::
138
+
1. Select **+** on the navigation bar to the left.
150
139
1. Configure client1 with
151
140
- **Name** as `client1` (this value can be anything)
152
141
- **Client ID** as `client1-session1` (Client ID in the CONNECT packet is used to identify the session ID for the client connection)
@@ -160,7 +149,7 @@ After a successful installation of Step, you should open a command prompt in you
160
149
1. Update the **port** to **8883**.
161
150
1. Toggle **SSL/TLS** to ON.
162
151
1. Toggle **SSL Secure** to ON, to ensure service certificate validation.
163
-
1. Select **Certificate** as **Self signed**.
152
+
1. Select **Certificate** as **CA or Self signed certificates**.
164
153
1. Provide the path for client certificate file.
165
154
1. Provide the path for the client key file.
166
155
1. Rest of the settings can be left with predefined default values.
@@ -192,7 +181,7 @@ After a successful installation of Step, you should open a command prompt in you
192
181
193
182
:::image type="content" source="./media/mqtt-publish-and-subscribe-portal/mqttx-app-subscribe-message.png" alt-text="Screenshot showing the message received by the subscribing client on MQTTX app." lightbox="./media/mqtt-publish-and-subscribe-portal/mqttx-app-subscribe-message.png":::
194
183
195
-
## Next steps
184
+
## Related content
196
185
- [Tutorial: Route MQTT messages to Azure Event Hubs using namespace topics](mqtt-routing-to-event-hubs-portal-namespace-topics.md)
197
186
- [Tutorial: Route MQTT messages to Azure Functions using custom topics](mqtt-routing-to-azure-functions-portal.md)
198
187
- For code samples, go to [this repository.](https://github.com/Azure-Samples/MqttApplicationSamples/tree/main)
0 commit comments