Skip to content

Commit e101db2

Browse files
committed
Event Grid - Pre Build updates
1 parent 17891b8 commit e101db2

File tree

5 files changed

+142
-91
lines changed

5 files changed

+142
-91
lines changed

articles/event-grid/authenticate-with-namespaces-using-json-web-tokens.md

Lines changed: 96 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,33 @@ title: Authenticate with namespaces using JSON Web Tokens
33
description: This article shows you how to authenticate with Azure Event Grid namespace using JSON Web Tokens.
44
ms.topic: how-to
55
ms.custom: build-2024, devx-track-azurecli
6-
ms.date: 01/27/2025
6+
ms.date: 04/30/2025
77
author: Connected-Seth
88
ms.author: seshanmugam
99
---
1010

11-
# Authenticate with namespaces using JSON Web Tokens
12-
This article shows how to authenticate with Azure Event Grid namespace using JSON Web Tokens.
11+
# Use OAuth 2.0 JSON Web Tokens (JWT) to authenticate with namespaces
12+
This article shows how to authenticate with Azure Event Grid namespace using OAuth 2.0 JSON Web Tokens.
1313

14-
Azure Event Grid's MQTT broker supports custom JWT authentication, which enables clients to connect and authenticate with an Event Grid namespace using JSON Web Tokens that are issued by any identity provider, aside from Microsoft Entra ID.
14+
Azure Event Grid's MQTT broker supports OAuth 2.0 JWT authentication, which enables clients to connect and authenticate with an Event Grid namespace using JSON Web Tokens that are issued by any identity provider, aside from Microsoft Entra ID.
1515

1616
## Prerequisites
1717

18-
To use custom JWT authentication for namespaces, you need to have the following prerequisites:
18+
To use OAuth 2.0 JWT authentication for namespaces, you need to have the following prerequisites:
1919

2020
- Identity provider that can issue JSON Web Tokens.
21-
- CA certificate that includes your public keys used to validate the client tokens.
22-
- Azure Key Vault account to host the CA certificate that includes your public keys.
21+
- CA certificate that includes your public keys used to validate the client tokens(Key Vault) or PEM file of your public key certificates(direct upload).
2322

2423
## High-level steps
2524

26-
To use custom JWT authentication for namespaces, follow these steps:
25+
To use OAuth 2.0 JWT authentication for namespaces, follow these steps:
2726

28-
1. Create a namespace and configure its subresources.
27+
1. Create a namespace and configure its subresources.
2928
1. Enable managed identity on your Event Grid namespace.
30-
1. Create an Azure Key Vault account that hosts the CA certificate that includes your public keys.
31-
1. Add role assignment in Azure Key Vault for the namespace’s managed identity.
32-
1. Configure custom authentication settings on your Event Grid namespace
33-
1. Your clients can connect to the Event Grid namespace using the tokens provided by your identity provider.
29+
1. Configure OAuth 2.0 authentication settings on your Event Grid namespace by following these steps:
30+
1. Create an Azure Key Vault account that hosts the CA certificate that includes your public keys and add role assignment in Key Vault for the namespace’s managed identity.
31+
1. Upload the PEM file of your public key certificates to namespace.
32+
1. Your clients can connect to the Event Grid namespace using the tokens provided by your identity provider.
3433

3534
## Create a namespace and configure its subresources
3635
Follow instructions from [Quickstart: Publish and subscribe to MQTT messages on Event Grid Namespace with Azure portal](mqtt-publish-and-subscribe-portal.md) to create a namespace and configure its subresources. Skip the certificate and client creation steps as the client identities come from the provided token. Client attributes are based on the custom claims in the client token. The client attributes are used in the client group query, topic template variables, and routing enrichment configuration.
@@ -81,7 +80,7 @@ You need to provide access to the namespace to access your Azure Key Vault accou
8180
8281
For more information about Key Vault access and the portal experience, see [Provide access to Key Vault keys, certificates, and secrets with an Azure role-based access control](/azure/key-vault/general/rbac-guide).
8382
84-
## Configure custom authentication settings on your Event Grid namespace
83+
## Configure OAuth 2.0 JWT authentication settings on your Event Grid namespace -Key Vault
8584
In this step, you configure custom authentication settings on your Event Grid namespace using Azure portal and Azure CLI. You need to create the namespace first then update it using the following steps.
8685
8786
### Use Azure portal
@@ -130,7 +129,7 @@ az resource update \
130129
}'
131130
132131
```
133-
## JSON Web Token format
132+
### JSON Web Token format
134133
JSON Web Tokens are divided into the JWT Header and JWT payload sections.
135134

136135
### JWT Header
@@ -184,6 +183,88 @@ Event Grid maps all claims to client attributes if they have one of the followin
184183
}
185184
```
186185

186+
## Configure OAuth 2.0 JWT authentication settings on your Event Grid namespace - Direct upload
187+
188+
In this step, you configure custom JWT authentication settings on your Event Grid namespace using Azure portal and Azure CLI. You need to create the namespace first then update it using the following steps.
189+
190+
## Use Azure portal
191+
1. Navigate to your Event Grid namespace in the Azure portal.
192+
1. On the Event Grid Namespace page, select Configuration on the left menu.
193+
1. In the Custom JWT authentication section, specify values for the following properties:
194+
1. Select **Enable custom JWT authentication**.
195+
1. **Token Issuer**: Enter the value of the issuer claims of the JWTs, presented by the MQTT clients.
196+
1. Select  issuer certificate option – **Direct Upload**.
197+
1. In the new page, specify values for the following properties.
198+
1. **Certificate**: upload your server certificate in PEM Format.
199+
1. **Kid**: A unique key identifier for the certificate.
200+
1. Select **Add**.
201+
1. Back on the **Configuration** page, select **Apply**.
202+
203+
204+
### Use Azure CLI
205+
Use the following command to update your namespace with the OAuth 2.0 JWT authentication configuration.
206+
207+
```azurecli
208+
az eventgrid namespace update \
209+
--resource-group <resource-group-name> \
210+
--name <namespace-name> \
211+
--api-version 2024-12-15-preview \
212+
--set customJwtAuthenticationSettings='{
213+
"tokenIssuer": "issuer-name",
214+
"encodedIssuerCertificates": [
215+
{
216+
"kid": "key1",
217+
"encodedCertificate": "-----BEGIN CERTIFICATE-----\n<certificate-in-PEM-format>\n-----END CERTIFICATE-----"
218+
}
219+
]
220+
}
221+
```
222+
223+
- Replace `<resource-group-name>`, `<namespace-name>`, `<location>`, `<key-vault-name>`, `<certificate-name>`, and `<certificate-in-PEM-format>` with your actual values.
224+
- The encodedCertificate value must include the full certificate in PEM format, including headers ( `"-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE----`).
225+
- Ensure the public key certificate provided is valid and trusted by your identity provider.
226+
- Regularly update the encodedIssuerCertificates if certificates are rotated or expired.
227+
228+
### JSON Web Token format
229+
230+
JWT payload
231+
232+
Event Grid requires the following claims: `iss`, `sub`, `aud`, `exp`, `nbf`.
233+
234+
* `kid` is optional. If it is present, then certificate with matching `kid` is used for validation.
235+
* List of standard claims that aren't used as attributes - `iss`, `sub`, `aud`, `exp`, `nbf`, `iat`, `jti`.
236+
* All claims which have correct data type (number that fits int32, string, array of strings) are used as attributes. In the example `num_attr_pos`, `num_attr_neg`, `str_attr`, `str_list_attr` claims have correct data types and are used as attributes.
237+
* In the example `bool_attr`, `num_attr_to_big`, `num_attr_float`, `obj_attr` claims have incorrect data types and aren't be used as attributes.
238+
239+
240+
```json
241+
{
242+
  "typ": "JWT",
243+
  "alg": "RS256",
244+
  "kid": "keyId1"
245+
}.{
246+
  "iss": "some-issuer",
247+
  "sub": "device1",
248+
  "aud": "event-grid-namespace.ts.eventgrid.azure.net",
249+
  "exp": 1770426501,
250+
  "nbf": 1738886901,
251+
  "bool_attr": true,
252+
  "num_attr_pos": 1,
253+
  "num_attr_neg": -1,
254+
  "num_attr_to_big": 9223372036854775807,
255+
  "num_attr_float": 1.23,
256+
  "str_attr": "str_value",
257+
  "str_list_attr": [
258+
    "str_value_1",
259+
    "str_value_2"
260+
  ],
261+
  "obj_attr": {
262+
      "key": "value"
263+
  }
264+
}
265+
```
266+
267+
187268
## Related content
188269
- [MQTT client authentication](mqtt-client-authentication.md)
189270
- [Authenticate client using custom JWT](mqtt-client-custom-jwt.md)

articles/event-grid/mqtt-client-authentication.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,21 @@ Azure Event Grid's MQTT broker supports the following authentication modes.
1515

1616
- Certificate-based authentication
1717
- Microsoft Entra ID authentication
18-
- Custom JWT authentication
18+
- OAuth 2.0 (JSON Web Token) authentication
1919

2020
## Certificate-based authentication
2121
You can use Certificate Authority (CA) signed certificates or self-signed certificates to authenticate clients. For more information, see [MQTT Client authentication using certificates](mqtt-client-certificate-authentication.md).
2222

2323
## Microsoft Entra ID authentication
2424
You can authenticate MQTT clients with Microsoft Entra JWT to connect to Event Grid namespace. You can use Azure role-based access control (Azure RBAC) to enable MQTT clients, with Microsoft Entra identity, to publish or subscribe access to specific topic spaces. For more information, see [Microsoft Entra JWT authentication and Azure RBAC authorization to publish or subscribe MQTT messages](mqtt-client-microsoft-entra-token-and-rbac.md).
2525

26-
## Custom JWT authentication
27-
You can authenticate MQTT clients using JSON Web Tokens (JWT) issued by any third-party OpenID Connect (OIDC) identity provider. This authentication method provides a lightweight, secure, and flexible option for MQTT clients that aren't provisioned in Azure. For more information, see [authenticate client using custom JWT](mqtt-client-custom-jwt.md)
26+
## OAuth 2.0 JWT authentication
27+
You can authenticate MQTT clients using JSON Web Tokens (JWT) issued by any third-party OpenID Connect (OIDC) identity provider. This authentication method provides a lightweight, secure, and flexible option for MQTT clients that aren't provisioned in Azure. For more information, see [Authenticate client using OAuth 2.0 JWT](mqtt-client-custom-jwt.md).
28+
29+
2830

2931
## Related content
3032
- Learn how to [authenticate clients using certificate chain](mqtt-certificate-chain-client-authentication.md)
3133
- Learn how to [authenticate client using Microsoft Entra ID token](mqtt-client-azure-ad-token-and-rbac.md)
32-
- Learn how to [authenticate client using custom JWT](mqtt-client-custom-jwt.md)
34+
- Learn how to[authenticate client using OAuth 2.0 JWT](mqtt-client-custom-jwt.md)
3335
- See [Transport layer security with MQTT broker](mqtt-transport-layer-security-flow.md)

articles/event-grid/mqtt-client-custom-jwt.md

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,34 @@
11
---
2-
title: Custom JWT authentication
3-
description: Describes custom JWT authentication and authorization to publish or subscribe to MQTT messages
2+
title: OAuth 2.0 JWT authentication
3+
description: Describes OAuth 2.0 JWT authentication and authorization to publish or subscribe to MQTT messages
44
ms.topic: conceptual
55
ms.custom: build-2024
6-
ms.date: 01/27/2025
6+
ms.date: 04/30/2025
77
author: Connected-Seth
88
ms.author: seshanmugam
99
ms.subservice: mqtt
1010
---
1111

12-
# Custom JWT authentication and authorization to publish or subscribe to MQTT messages
12+
# OAuth 2.0 JSON Web Token (JWT) authentication and authorization to publish or subscribe to MQTT messages
1313

14-
You can authenticate MQTT clients with Custom JWT to connect to the Event Grid namespace. You can embed and validate custom claims in the JWT to authorize publish or subscribe permissions to your Event Grid topic spaces.
14+
You can authenticate MQTT clients with OAuth 2.0 JWT to connect to the Event Grid namespace. You can embed and validate custom claims in the JWT to authorize publish or subscribe permissions to your Event Grid topic spaces.
1515

1616
> [!IMPORTANT]
1717
> - This feature is supported only when using the MQTT v5 protocol version.
1818
1919
## Prerequisites
20-
- You need an Event Grid namespace with MQTT enabled. Learn about [creating Event Grid namespace](/azure/event-grid/create-view-manage-namespaces#create-a-namespace)
20+
- You need an Event Grid namespace with MQTT enabled. Learn about [creating Event Grid namespace](/azure/event-grid/create-view-manage-namespaces#create-a-namespace)
2121

2222
<a name='authentication-using-azure-ad-jwt'></a>
2323

24-
## Authentication using Custom JWT
25-
You can use the MQTT v5 CONNECT packet to provide the Custom JWT to authenticate your client and the MQTT v5 AUTH packet to refresh the token.
26-
27-
> [!IMPORTANT]
28-
> - If you don't set the CONNECT packet's authentication method to CUSTOM-JWT, you receive an 'invalid issuer' error—even if all other configurations are correct.
29-
30-
In the CONNECT packet, you can provide the required values in the following fields:
31-
32-
|Field | Value |
33-
|---------|---------|
34-
|Authentication Method | CUSTOM-JWT |
35-
|Authentication Data | JWT |
36-
37-
In the AUTH packet, you can provide the required values in the following fields:
38-
39-
|Field | Value |
40-
|---------|---------|
41-
| Authentication Method | CUSTOM-JWT |
42-
| Authentication Data | JWT |
43-
| Authentication Reason Code | 25 |
44-
45-
Authenticate Reason Code with value 25 signifies reauthentication.
24+
## Authentication using OAuth 2.0 JWT
25+
You can use the MQTT v5 CONNECT packet to provide the OAuth 2.0 JWT to authenticate your client and the MQTT v5 AUTH packet to refresh the token.
4626

4727
> [!NOTE]
48-
> - Audience: 'aud' claim must be set to "https://eventgrid.azure.net/".
28+
> - Audience: `aud` claim must be set to `https://[namespace].ts.eventgrid.azure.net/`.
4929
5030
## Access permissions
51-
A client using Custom JWT authentication can use client attributes and permissions to limit access to specific topics.
31+
A client using OAuth 2.0 JWT authentication can use client attributes and permissions to limit access to specific topics.
5232

5333
## Next steps
5434
- See [Publish and subscribe to MQTT message using Event Grid](mqtt-publish-and-subscribe-portal.md)

articles/event-grid/mqtt-events-fabric.md

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,41 @@
22
title: Send MQTT events to Microsoft Fabric via Event Hubs
33
description: Shows you how to use Event Grid to send events from MQTT clients to Microsoft Fabric via Azure Event Hubs.
44
ms.topic: how-to
5-
ms.date: 02/13/2024
6-
author: spelluru
7-
ms.author: spelluru
5+
ms.date: 04/30/2025
6+
author: Connected-Seth
7+
ms.author: seshanmugam
88
ms.subservice: mqtt
99
---
1010

11-
# How to send MQTT events to Microsoft Fabric via Event Hubs using Azure Event Grid
12-
This article shows you how to use Azure Event Grid to send events from MQTT clients to Microsoft Fabric data stores via Azure Event Hubs.
11+
# How to send MQTT events to Microsoft Fabric using Azure Event Grid (Preview)
12+
This article shows you how to use Azure Event Grid to send events from MQTT clients to Microsoft Fabric eventstream.
1313

1414
## High-level steps
1515

16-
1. Create a namespace topic that receives events from MQTT clients.
17-
2. Create a subscription to the topic using Event Hubs as the destination.
18-
3. Create an event stream in Microsoft Fabric with the event hub as a source and a Fabric KQL database or Lakehouse as a destination.
19-
20-
## Event flow
21-
22-
1. MQTT client sends events to your Event Grid namespace topic.
23-
2. Event subscription to the namespace topic forwards those events to your event hub.
24-
3. Fabric event stream receives events from the event hub and stores them in a Fabric destination such as a KQL database or a lakehouse.
16+
1. Create an Azure Event Grid namespace.
17+
1. Create a namespace topic in the namespace that receives events from MQTT clients.
18+
1. Enable managed identity on the Event Grid namespace.
19+
1. Enable MQTT and routing on the Event Grid namespace, if you want to receive Message Queuing Telemetry Transport (MQTT) data.
20+
1. Create an event stream in Microsoft Fabric.
2521

2622
## Detailed steps
2723

28-
1. Follow steps from the article: [Tutorial: Use namespace topics to route MQTT messages to Azure Event Hubs (Azure portal)](mqtt-routing-to-event-hubs-portal-namespace-topics.md) to:
29-
1. Create an Event Grid namespace in the Azure portal.
30-
1. Create a namespace topic.
31-
1. Enable managed identity for the namespace.
32-
1. Enable MQTT broker for the Event Grid namespace.
33-
1. Create an Event Hubs namespace.
34-
1. Create an event hub.
35-
1. Grant Event Grid namespace the permission to send events to the event hub.
36-
1. Create an event subscription to namespace topic with the event hub as the endpoint.
37-
1. Configure routing for the Event Grid namespace.
24+
1. Follow steps from the article: [QuickStart: Publish and subscribe to MQTT messages on Event Grid Namespace with Azure portal](mqtt-publish-and-subscribe-portal.md) to:
25+
1. Create Event Grid namespace in the Azure portal.
26+
1. Create a namespace topic.
27+
1. Enable managed identity for the namespace.
28+
1. Enable MQTT broker for the Event Grid namespace.
29+
1. Configure routing for the Event Grid namespace.
3830
1. Create clients, topic space, and permission bindings.
39-
1. Use MQTTX tool to send a few test events or messages.
40-
1. In Microsoft Fabric, do these steps:
41-
1. [Create a lakehouse](/fabric/onelake/create-lakehouse-onelake#create-a-lakehouse).
42-
2. [Create an event stream](/fabric/real-time-analytics/event-streams/create-manage-an-eventstream#create-an-eventstream).
43-
3. [Add your event hub as an input source](/fabric/real-time-analytics/event-streams/add-manage-eventstream-sources#add-an-azure-event-hub-as-a-source).
44-
4. [Add your lakehouse as a destination](/fabric/real-time-analytics/event-streams/add-manage-eventstream-destinations#add-a-lakehouse-as-a-destination).
45-
1. [Publish events to the namespace topic](publish-deliver-events-with-namespace-topics.md#send-events-to-your-topic).
31+
1. Use MQTTX tool to send a few test events or messages.
32+
1. In Microsoft Fabric, follow the steps from the article: [Add Azure Event Grid Namespace source to an eventstream (Preview)](add-source-azure-event-grid.md)
33+
1. Create workspace in Fabric.
34+
1. Create an eventstream.
35+
1. Create an Azure Event Grid namespace datasource.
36+
1. Preview Data in the eventstream.
4637

4738
## Next steps
48-
Build a Power BI report as shown in the sample: [Build a near-real-time Power BI report with the event data ingested in a lakehouse](/fabric/real-time-analytics/event-streams/transform-and-stream-real-time-events-to-lakehouse).
49-
39+
To learn how to add other sources to an eventstream, see the following article: [Add and manage an event source in an eventstream](add-manage-eventstream-sources.md).
5040

5141

5242

articles/event-grid/oauth-json-web-token-authentication.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
title: Namespace authentication using JSON Web Tokens
33
description: This article describes authentication of Azure Event Grid namespaces using JSON Web Tokens.
44
ms.topic: how-to
5-
ms.custom:
6-
- build-2024
7-
ms.date: 05/21/2024
8-
author: george-guirguis
9-
ms.author: geguirgu
5+
ms.date: 04/30/2025
6+
author: Connected-Seth
7+
ms.author: seshanmugam
108
---
119

1210
# OAuth 2.0 (JSON Web Token) authentication with Azure Event Grid namespaces
@@ -19,13 +17,13 @@ OAuth 2.0 (JSON Web Token) authentication allows clients to authenticate and con
1917
2018
## High-level steps
2119

22-
To use custom JWT authentication for namespaces, follow these steps:
20+
To use OAuth 2.0 JWT authentication for namespaces, follow these steps:
2321

2422
1. Create a namespace and configure its subresources.
2523
1. Enable managed identity on your Event Grid namespace.
26-
1. Create an Azure Key Vault account that hosts the CA certificate that includes your public keys.
27-
1. Add role assignment in Azure Key Vault for the namespace’s managed identity.
28-
1. Configure custom authentication settings on your Event Grid namespace
24+
1. Configure OAuth 2.0 authentication settings on your Event Grid namespace by following these steps:
25+
1. Create an Azure **Key Vault** account that hosts the CA certificate that includes your public keys and add role assignment in Key Vault for the namespace’s managed identity.
26+
1. Upload the Privacy-Enhanced Mail (PEM) file of your public key certificates to namespace.
2927
1. Your clients can connect to the Event Grid namespace using the tokens provided by your identity provider.
3028

3129

0 commit comments

Comments
 (0)