Events
17 Mar, 21 - 21 Mar, 10
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In this article, you learn about configuring MQTT clients and client groups.
Clients can be devices or applications, such as devices or vehicles that send/receive MQTT messages.
For example, consider a fleet management company with hundreds of trucks and other shipment delivery vehicles. You can improve their routing, tracking, driver safety and predictable maintenance capabilities by sending and receiving MQTT messages to/from a cloud service.
In this scenario, vehicles can be configured as clients that publish/subscribe to various topics such as weather information, road conditions, geo location, engine performance and other wear-and-tear aspects of the vehicle. And, while configuring the vehicle as a client, a set of attributes such as vehicle type, year, make & model, max load capacity, etc. can also be included in the client metadata.
Note
Client Authentication Name: You can provide a unique identifier for the client without Azure Resource Manager naming constraints. It's a mandatory field and if not explicitly provided, it's defaulted to the Client Name.
No two clients can have same authentication name within a Namespace. While authenticating a client, we treat Client authentication name as case insensitive.
We preserve the original case of client authentication name that you configure in the client. We use the original client authentication name (case sensitive) that was provided when client was created, in routing enrichments, topic space matching, etc.
Note
Client Certificate Authentication Validation Scheme: To use CA certificate for authentication, you can choose from one of following options to specify the location of the client identity in the client certificate. When the client tries to connect to the service, service finds the client identify from this certificate field and matches it with the client authentication name to authenticate the client.
We support five certificate fields:
Use the "Thumbprint Match" option while using self-signed certificate to authenticate the client.
Note
Client attributes
Client attributes are a set of user defined key-value pairs or tags that provide information about the client.
These client attributes can be used to create the client groups. For example, you can group all the vehicles of type semi-trucks into one group and all the vehicles of type pickup-trucks into another.
These attributes are used in the client group queries to filter a set of clients. Attributes could be describing the physical or functional characteristics of the client. Typical attribute could be "type" of the client.
Here's an example:
Here’s a sample schema for the client with attribute definition:
{
"id": "device123",
"attributes": {
"type": "home-sensors",
"sensors": ["motion", "noise", "light"]
}
}
While configuring the client attributes, consider the topics that the clients publish (subscribe) to. Thinking backwards from topics to clients helps identify the commonalities across client roles easier and defining the client attributes to make the client grouping simpler.
Note
string
, integer
or array of strings
types.Example for certificate chain based client authentication
{
"properties": {
"authenticationName": "127.0.0.1",
"state": "Enabled",
"clientCertificateAuthentication": {
"validationScheme": "IpMatchesAuthenticationName"
},
"attributes": {
"room": "345",
"floor": 3,
"bldg": "17"
},
"description": "Description of the client"
}
}
Example for self-signed certificate thumbprint based client authentication
{
"properties": {
"authenticationName": "abcd@domain.com-1",
"state": "Enabled",
"clientCertificateAuthentication": {
"validationScheme": "ThumbprintMatch",
"allowedThumbprints": ["primary", "secondary"]
},
"attributes": {
"room": "345",
"floor": "3",
"bldg": 17
},
"description": "Description of the client"
}
}
Use the following steps to create a client:
Go to your namespace in the Azure portal
Under Clients, select + Client.
Choose the client certificate authentication validation scheme. For more information about client authentication configuration, see client authentication article.
Add client attributes.
Use the following commands to create/show/delete a client
Create client
az eventgrid namespace client create -g myRG --namespace-name myNS -n myClient
Get client
az eventgrid namespace client show -g myRG --namespace-name myNS -n myClient
Delete client
az eventgrid namespace client delete -g myRG --namespace-name myNS -n myClient
Events
17 Mar, 21 - 21 Mar, 10
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Certification
Microsoft Certified: Azure Administrator Associate - Certifications
Demonstrate key skills to configure, manage, secure, and administer key professional functions in Microsoft Azure.