Skip to content

Commit 517d589

Browse files
committed
Added Entra warning messages, wording, and sample links
1 parent d00f043 commit 517d589

7 files changed

+35
-11
lines changed

includes/iot-hub-howto-connect-service-iothub-entra-dotnet.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: iot-hub
88
ms.devlang: csharp
99
ms.topic: include
1010
ms.manager: lizross
11-
ms.date: 11/06/2024
11+
ms.date: 11/19/2024
1212
ms.custom: mqtt, devx-track-csharp, devx-track-dotnet
1313
---
1414

@@ -76,3 +76,7 @@ In this example, the `TokenCredential` is passed to `RegistryManager.Create` to
7676
string hostname = "xxxxxxxxxx.azure-devices.net";
7777
registryManager = RegistryManager.Create(hostname, tokenCredential);
7878
```
79+
80+
##### Code samples
81+
82+
For working samples of Microsoft Entra service authentication, see [Role based authentication sample](https://github.com/Azure/azure-iot-sdk-csharp/tree/main/iothub/service/samples/how%20to%20guides/RoleBasedAuthenticationSample).

includes/iot-hub-howto-connect-service-iothub-entra-java.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: iot-hub
88
ms.devlang: java
99
ms.topic: include
1010
ms.manager: lizross
11-
ms.date: 11/06/2024
11+
ms.date: 11/19/2024
1212
---
1313

1414
A backend app that uses Microsoft Entra must successfully authenticate and obtain a security token credential before connecting to IoT Hub. This token is passed to a IoT Hub connection method. For general information about setting up and using Microsoft Entra for IoT Hub, see [Control access to IoT Hub by using Microsoft Entra ID](/azure/iot-hub/authenticate-authorize-azure-ad).
@@ -33,7 +33,7 @@ For more information about setting up a Microsoft Entra app, see [Quickstart: Re
3333

3434
The easiest way to use Microsoft Entra to authenticate a backend application is to use [DefaultAzureCredential](/azure/developer/java/sdk/authentication/credential-chains#defaultazurecredential-overview), but it's recommended to use a different method in a production environment including a specific `TokenCredential` or pared-down `ChainedTokenCredential`.
3535
For more information about the pros and cons of using `DefaultAzureCredential`, see
36-
[ChainedTokenCredential](/azure/developer/java/sdk/authentication/credential-chains).
36+
[Credential chains in the Azure Identity client library for Java](/azure/developer/java/sdk/authentication/credential-chains).
3737

3838
[DefaultAzureCredential](/java/api/com.azure.identity.defaultazurecredential) supports different authentication mechanisms and determines the appropriate credential type based on the environment it's executing in. It attempts to use multiple credential types in an order until it finds a working credential.
3939

includes/iot-hub-howto-connect-service-iothub-entra-node.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: iot-hub
88
ms.devlang: javascript
99
ms.topic: include
1010
ms.manager: lizross
11-
ms.date: 11/06/2024
11+
ms.date: 11/19/2024
1212
---
1313

1414
A backend app that uses Microsoft Entra must successfully authenticate and obtain a security token credential before connecting to IoT Hub. This token is passed to a IoT Hub connection method. For general information about setting up and using Microsoft Entra for IoT Hub, see [Control access to IoT Hub by using Microsoft Entra ID](/azure/iot-hub/authenticate-authorize-azure-ad).
@@ -88,3 +88,7 @@ const credential = new DefaultAzureCredential()
8888
hostName = 'MyAzureDomain.azure-devices.net';
8989
let registry = Registry.fromTokenCredential(hostName,credential);
9090
```
91+
92+
##### Code samples
93+
94+
For working samples of Microsoft Entra service authentication, see [Azure identity examples](https://github.com/Azure/azure-sdk-for-js/blob/@azure/identity_4.5.0/sdk/identity/identity/samples/AzureIdentityExamples.md).

includes/iot-hub-howto-connect-service-iothub-entra-python.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: iot-hub
88
ms.devlang: python
99
ms.topic: include
1010
ms.manager: lizross
11-
ms.date: 11/06/2024
11+
ms.date: 11/19/2024
1212
---
1313

1414
A backend app that uses Microsoft Entra must successfully authenticate and obtain a security token credential before connecting to IoT Hub. This token is passed to a IoT Hub connection method. For general information about setting up and using Microsoft Entra for IoT Hub, see [Control access to IoT Hub by using Microsoft Entra ID](/azure/iot-hub/authenticate-authorize-azure-ad).
@@ -50,7 +50,7 @@ from azure.identity import DefaultAzureCredential
5050
credential = DefaultAzureCredential()
5151
```
5252

53-
The resulting [AccessToken](/python/api/azure-core/azure.core.credentials.accesstoken) can then be passed to `from_token_credential` to connect to IoT Hub method for any SDK client that accepts Microsoft Entra credentials:
53+
The resulting [AccessToken](/python/api/azure-core/azure.core.credentials.accesstoken) can then be passed to `from_token_credential` to connect to IoT Hub for any SDK client that accepts Microsoft Entra credentials:
5454

5555
* [IoTHubRegistryManager](/python/api/azure-iot-hub/azure.iot.hub.iothubregistrymanager?#azure-iot-hub-iothubregistrymanager-from-token-credential) to create a service connection to IoT Hub using an Entra token credential.
5656
* [IoTHubJobManager](/python/api/azure-iot-hub/azure.iot.hub.iothubjobmanager?#azure-iot-hub-iothubjobmanager-from-token-credential)
@@ -91,3 +91,7 @@ iothub_registry_manager = IoTHubRegistryManager.from_token_credential(
9191
url="MyAzureDomain.azure-devices.net",
9292
token_credential=credential)
9393
```
94+
95+
##### Code samples
96+
97+
For working samples of Microsoft Entra service authentication, see [Microsoft Authentication Library (MSAL) for Python](https://github.com/AzureAD/microsoft-authentication-library-for-python/blob/1.22.0/README.md).

includes/iot-hub-howto-module-twins-dotnet.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.author: kgremban
77
ms.service: iot-hub
88
ms.devlang: csharp
99
ms.topic: include
10-
ms.date: 10/02/2024
10+
ms.date: 11/19/2024
1111
ms.custom: mqtt, devx-track-csharp, devx-track-dotnet
1212
---
1313

@@ -25,6 +25,8 @@ This section describes how to use device application code to:
2525
* Update reported module identity twin properties
2626
* Create a module desired property update callback handler
2727

28+
[!INCLUDE [iot-authentication-device-connection-string.md](../../includes/iot-authentication-device-connection-string.md)]
29+
2830
### Required device NuGet package
2931

3032
Device client applications written in C# require the **Microsoft.Azure.Devices.Client** NuGet package.
@@ -136,10 +138,10 @@ The Azure IoT SDK for .NET provides working samples of device apps that handle m
136138

137139
## Create a backend application
138140

139-
The [RegistryManager](/dotnet/api/microsoft.azure.devices.registrymanager) class exposes all methods required to create a backend application to interact with module identity twins from the service.
140-
141141
This section describes how to read and update module identity fields.
142142

143+
The [RegistryManager](/dotnet/api/microsoft.azure.devices.registrymanager) class exposes all methods required to create a backend application to interact with module identity twins from the service.
144+
143145
### Required service NuGet package
144146

145147
Backend service applications require the **Microsoft.Azure.Devices** NuGet package.
@@ -158,6 +160,8 @@ You can connect a backend service to IoT Hub using the following methods:
158160
* Shared access policy
159161
* Microsoft Entra
160162

163+
[!INCLUDE [iot-authentication-service-connection-string.md](../../includes/iot-authentication-service-connection-string.md)]
164+
161165
#### Connect using a shared access policy
162166

163167
Connect a backend application to IoT hub using [CreateFromConnectionString](/dotnet/api/microsoft.azure.devices.registrymanager.createfromconnectionstring).

includes/iot-hub-howto-module-twins-node.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.author: kgremban
77
ms.service: iot-hub
88
ms.devlang: nodejs
99
ms.topic: include
10-
ms.date: 10/02/2024
10+
ms.date: 11/19/2024
1111
ms.custom: mqtt, devx-track-js
1212
---
1313

@@ -27,6 +27,8 @@ This section describes how to use the [azure-iot-device](/javascript/api/azure-i
2727
* Update module identity reported twin properties
2828
* Receive notice of module identity twin desired property changes
2929

30+
[!INCLUDE [iot-authentication-device-connection-string.md](../../includes/iot-authentication-device-connection-string.md)]
31+
3032
### Install SDK packages
3133

3234
Run this command to install the **azure-iot-device** device SDK on your development machine:
@@ -330,6 +332,8 @@ You can connect a backend service to IoT Hub using the following methods:
330332
* Shared access policy
331333
* Microsoft Entra
332334
335+
[!INCLUDE [iot-authentication-service-connection-string.md](../../includes/iot-authentication-service-connection-string.md)]
336+
333337
#### Connect using a shared access policy
334338
335339
Use [fromConnectionString](/javascript/api/azure-iothub/registry?#azure-iothub-registry-fromconnectionstring) to connect to IoT hub.

includes/iot-hub-howto-module-twins-python.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.author: kgremban
77
ms.service: iot-hub
88
ms.devlang: python
99
ms.topic: include
10-
ms.date: 09/03/2024
10+
ms.date: 11/19/2024
1111
ms.custom: mqtt, devx-track-python, py-fresh-zinc
1212
---
1313

@@ -47,6 +47,8 @@ This section describes how to use device application code to:
4747
* Update module identity twin reported properties
4848
* Create a module identity twin desired property update callback handler
4949

50+
[!INCLUDE [iot-authentication-device-connection-string.md](../../includes/iot-authentication-device-connection-string.md)]
51+
5052
### Import statements
5153

5254
Add this `import` statement to use the device library.
@@ -169,6 +171,8 @@ You can connect a backend service to IoT Hub using the following methods:
169171
* Shared access policy
170172
* Microsoft Entra
171173

174+
[!INCLUDE [iot-authentication-service-connection-string.md](../../includes/iot-authentication-service-connection-string.md)]
175+
172176
#### Connect using a shared access policy
173177

174178
Connect to IoT hub using [from_connection_string](/python/api/azure-iot-hub/azure.iot.hub.iothubregistrymanager?#azure-iot-hub-iothubregistrymanager-from-connection-string).

0 commit comments

Comments
 (0)