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-event-grid-namespace-terminology.md
+25-9Lines changed: 25 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,45 +13,61 @@ Key terms relevant for Event Grid namespace and MQTT resources are explained.
13
13
14
14
## Namespace
15
15
16
-
An Event Grid namespace is a declarative space that provides a scope to all the nested resources or subresources such as topics, certificates, clients, client groups, topic spaces, permission bindings. It gives you a unique FQDN.
16
+
An Event Grid namespace is a declarative space that provides a scope to all the nested resources or subresources such as topics, certificates, clients, client groups, topic spaces, permission bindings.
17
17
18
-
Namespace is a tracked resource with 'tags' and a 'location' properties, and once created can be found on resources.azure.com.
18
+
| Resource | Protocol supported |
19
+
| :--- | :---: |
20
+
| Namespace topics | HTTP |
21
+
| Topic Spaces | MQTT |
22
+
| Clients | MQTT |
23
+
| Client Groups | MQTT |
24
+
| CA Certificates | MQTT |
25
+
| Permission bindings | MQTT |
19
26
20
27
Using the namespace, you can organize the subresources into logical groups and manage them as a single unit in your Azure subscription. Deleting a namespace deletes all the subresources encompassed within the namespace.
21
28
29
+
It gives you a unique FQDN. A Namespace exposes two endpoints:
30
+
31
+
- An HTTP endpoint to support general messaging requirements using Namespace Topics.
32
+
- An MQTT endpoint for IoT messaging or solutions that use MQTT.
33
+
34
+
A Namespace also provides DNS-integrated network endpoints and a range of access control and network integration management features such as IP ingress filtering and private links. It's also the container of managed identities used for all contained resources that use them.
35
+
36
+
Namespace is a tracked resource with 'tags' and a 'location' properties, and once created can be found on resources.azure.com.
37
+
22
38
The name of the namespace can be 3-50 characters long. It can include alphanumeric, and hyphen(-), and no spaces. The name needs to be unique per region.
23
39
24
40
## Client
25
41
26
-
Client is a device or an application that can publish and/or subscribe MQTT messages.
42
+
Client is a device or an application that can publish and/or subscribe MQTT messages. For more information about client configuration, see [MQTT clients](mqtt-clients.md).
27
43
28
44
## Certificate / Cert
29
45
30
-
Certificate is a form of asymmetric credential. They're a combination of a public key from an asymmetric keypair and a set of metadata describing the valid uses of the keypair. If the keypair of the issuer is the same keypair as the certificate, the certificate is said to be "self-signed". Third-party certificate issuers are sometimes called Certificate Authorities (CA).
46
+
Certificate is a form of asymmetric credential. They're a combination of a public key from an asymmetric keypair and a set of metadata describing the valid uses of the keypair. If the keypair of the issuer is the same keypair as the certificate, the certificate is said to be "self-signed". Third-party certificate issuers are sometimes called Certificate Authorities (CA). For more information about client authentication, see [MQTT client authentication](mqtt-client-authentication.md).
31
47
32
48
## Client attributes
33
49
34
-
Client attributes represent a set of key-value pairs that provide descriptive information about the client. Client attributes are used in creating client groups and as variables in Topic Templates. For example, client type is an attribute that provides the client's type.
50
+
Client attributes represent a set of key-value pairs that provide descriptive information about the client. Client attributes are used in creating client groups and as variables in Topic Templates. For example, client type is an attribute that provides the client's type. For more information about client configuration, see [MQTT clients](mqtt-clients.md).
35
51
36
52
## Client group
37
53
38
-
Client group is a collection of clients. Clients can be grouped together using common client attribute(s). Client groups can be given permissions to publish and/or subscribe to a specific topic space.
54
+
Client group is a collection of clients. Clients can be grouped together using common client attribute(s). Client groups can be given permissions to publish and/or subscribe to a specific topic space. For more information about client groups configuration, see [MQTT client groups](mqtt-client-groups.md).
39
55
40
56
## Topic space
41
57
42
-
Topic space is a set of topic templates. It's used to simplify access control management by enabling you to grant publish or subscribe access to a group of topics at once instead of individual topics.
58
+
Topic space is a set of topic templates. It's used to simplify access control management by enabling you to grant publish or subscribe access to a group of topics at once instead of individual topics. For more information about topic spaces configuration, see [MQTT topic spaces](mqtt-topic-spaces.md).
43
59
44
60
## Topic filter
45
61
46
62
An MQTT topic filter is an MQTT topic that can include wildcards for one or more of its segments, allowing it to match multiple MQTT topics. It's used to simplify subscriptions declarations as one topic filter can match multiple topics.
47
63
48
64
## Topic template
49
65
50
-
Topic templates are an extension of the topic filter that supports variables. It's used for fine-grained access control within a client group.
66
+
Topic templates are an extension of the topic filter that supports variables. It's used for fine-grained access control within a client group.
51
67
52
68
## Permission bindings
53
69
54
-
A Permission Binding grants access to a specific client group to either publish or subscribe on a specific topic space.
70
+
A Permission Binding grants access to a specific client group to either publish or subscribe on a specific topic space. For more information about permission bindings, see [MQTT access control](mqtt-access-control.md).
@@ -113,18 +113,16 @@ Store the below object in topicspace.json file.
113
113
114
114
```json
115
115
{
116
-
"properties": {
117
-
"topicTemplates": [
118
-
"contosotopics/topic1"
119
-
]
120
-
}
116
+
"topicTemplates": [
117
+
"contosotopics/topic1"
118
+
]
121
119
}
122
120
```
123
121
124
122
Use the az resource command to create the topic space. Update the command with your subscription ID, Resource group ID, namespace name, and a topic space name.
125
123
126
124
```azurecli-interactive
127
-
az resource create --resource-type Microsoft.EventGrid/namespaces/topicSpaces --id /subscriptions/{Subscription ID}/resourceGroups/{Resource Group}/providers/Microsoft.EventGrid/namespaces/{Namespace Name}/topicSpaces/{Topic Space Name} --is-full-object --api-version 2023-06-01-preview --properties @./resources/topicspace.json
125
+
az resource create --resource-type Microsoft.EventGrid/namespaces/topicSpaces --id /subscriptions/{Subscription ID}/resourceGroups/{Resource Group}/providers/Microsoft.EventGrid/namespaces/{Namespace Name}/topicSpaces/{Topic Space Name} --api-version 2023-06-01-preview --properties @./resources/topicspace.json
128
126
```
129
127
130
128
## Create PermissionBindings
@@ -133,11 +131,9 @@ Store the first permission binding object in permissionbinding1.json file. Repl
133
131
134
132
```json
135
133
{
136
-
"properties": {
137
-
"clientGroupName": "$all",
138
-
"permission": "Publisher”,
139
-
"topicSpaceName": "{Your topicspace name}"
140
-
}
134
+
"clientGroupName": "$all",
135
+
"permission": "Publisher",
136
+
"topicSpaceName": "{Your topicspace name}"
141
137
}
142
138
```
143
139
@@ -151,11 +147,9 @@ Store the second permission binding object in permissionbinding2.json file. Rep
151
147
152
148
```json
153
149
{
154
-
"properties": {
155
-
"clientGroupName": "$all",
156
-
"permission": "Subscriber”,
157
-
"topicSpaceName": "{Your topicspace name}"
158
-
}
150
+
"clientGroupName": "$all",
151
+
"permission": "Subscriber",
152
+
"topicSpaceName": "{Your topicspace name}"
159
153
}
160
154
```
161
155
@@ -177,6 +171,9 @@ You need to install the MQTTnet package (version 4.1.4.563) from NuGet to run th
177
171
178
172
**Sample C# code to connect a client, publish/subscribe MQTT message on a topic**
179
173
174
+
> [!IMPORTANT]
175
+
> Please update the client certificate and key pem file paths depending on location of your client certificate files. Also, ensure the client authentication name, topic information match with your configuration.
176
+
180
177
```csharp
181
178
usingMQTTnet.Client;
182
179
usingMQTTnet;
@@ -193,7 +190,8 @@ var mqttClient = new MqttFactory().CreateMqttClient();
Copy file name to clipboardExpand all lines: articles/event-grid/mqtt-publish-and-subscribe-portal.md
+13-10Lines changed: 13 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,27 +123,30 @@ If you don't already have a certificate, you can create a sample certificate usi
123
123
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/.
124
124
125
125
:::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.":::
126
-
2. Configure client1 with
126
+
127
+
1. Configure client1 with
127
128
- Name as client-name-1 (this value can be anything)
128
129
- Client ID as client1-sessionID1 (Client ID in CONNECT packet is used to identify the session ID for the client connection)
129
130
- Username as client1-authnID (Username must match the client authentication name in client metadata)
130
-
3. Update the host name to MQTT hostname from the Overview page of the namespace.
131
+
132
+
1. Update the host name to MQTT hostname from the Overview page of the namespace.
131
133
132
134
:::image type="content" source="./media/mqtt-publish-and-subscribe-portal/event-grid-namespace-overview.png" alt-text="Screenshot showing Event Grid namespace overview page, which has MQTT hostname.":::
133
135
134
-
4. Toggle SSL/TLS to ON.
135
-
5. You can leave the SSL Secure ON.
136
-
6. Select Certificate as Self signed.
137
-
7. Provide the path to client.cer.pem file for Client Certificate File.
138
-
8. Provide the path to client.key.pem file for Client key file.
139
-
9. Rest of the settings can be left with predefined default values.
136
+
1. Update the port to 8883
137
+
1. Toggle SSL/TLS to ON.
138
+
1. Toggle SSL Secure to ON, to ensure service certificate validation.
139
+
1. Select Certificate as Self signed.
140
+
1. Provide the path to client.cer.pem file for Client Certificate File.
141
+
1. Provide the path to client.key.pem file for Client key file.
142
+
1. Rest of the settings can be left with predefined default values.
140
143
141
144
:::image type="content" source="./media/mqtt-publish-and-subscribe-portal/mqttx-app-client1-configuration-1.png" alt-text="Screenshot showing client 1 configuration part 1 on MQTTX app.":::
142
145
143
146
:::image type="content" source="./media/mqtt-publish-and-subscribe-portal/mqttx-app-client1-configuration-2.png" alt-text="Screenshot showing client 1 configuration part 2 on MQTTX app.":::
144
147
145
-
10. Select Connect to connect the client to the Event Grid MQTT service.
146
-
11. Repeat the above steps to connect the second client “client2”, with corresponding authentication information as shown.
148
+
1. Select Connect to connect the client to the Event Grid MQTT service.
149
+
1. Repeat the above steps to connect the second client “client2”, with corresponding authentication information as shown.
147
150
148
151
:::image type="content" source="./media/mqtt-publish-and-subscribe-portal/mqttx-app-client2-configuration-1.png" alt-text="Screenshot showing client 2 configuration part 1 on MQTTX app.":::
0 commit comments