Skip to content

Commit 4d107eb

Browse files
committed
added policy steps
1 parent 0db93e8 commit 4d107eb

File tree

4 files changed

+36
-4
lines changed

4 files changed

+36
-4
lines changed

articles/iot-hub/iot-hub-python-python-module-twin-getstarted.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.service: iot-hub
66
services: iot-hub
77
ms.devlang: python
88
ms.topic: conceptual
9-
ms.date: 07/30/2019
9+
ms.date: 04/03/2020
1010
ms.author: menchi
1111
---
1212

@@ -38,9 +38,9 @@ At the end of this tutorial, you have three Python apps:
3838

3939
## Get the IoT hub connection string
4040

41-
[!INCLUDE [iot-hub-howto-module-twin-shared-access-policy-text](../../includes/iot-hub-howto-module-twin-shared-access-policy-text.md)]
41+
In this article, you create a back-end service that adds a device in the identity registry and then adds a module to that device. This service requires the **registry write** permission. You also create a service that adds desired properties to the module twin for the newly created module. This service needs the **service connect** permission. Although there are default shared access policies that grant these permissions individually, in this section, you create a custom shared access policy that contains both of these permissions. (The **registry read** permission is included with **registry write**.)
4242

43-
[!INCLUDE [iot-hub-include-find-registryrw-connection-string](../../includes/iot-hub-include-find-registryrw-connection-string.md)]
43+
[!INCLUDE [iot-hub-include-find-service-regrw-connection-string](../../includes/iot-hub-include-find-service-regrw-connection-string.md)]
4444

4545
## Create a device identity and a module identity in IoT Hub
4646

@@ -179,7 +179,7 @@ In this section, you create a Python service app that updates the module twin de
179179
180180
## Get updates on the device side
181181
182-
In this section, you create a Python device app to get the module twin desired properties update on your device.
182+
In this section, you create a Python app to get the module twin desired properties update on your device.
183183
184184
1. Get your module connection string. In [Azure portal](https://portal.azure.com/), navigate to your IoT Hub and select **IoT devices** in the left pane. Select **myFirstDevice** from the list of devices and open it. Under **Module identities**, select **myFirstModule**. Copy the module connection string. You need it in a following step.
185185
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: include file
3+
description: include file
4+
author: robinsh
5+
ms.service: iot-hub
6+
services: iot-hub
7+
ms.topic: include
8+
ms.date: 04/03/2020
9+
ms.author: robinsh
10+
ms.custom: include file
11+
---
12+
<!-- This tells how to create a custom shared access policy that has service connect and registry RW permissions for your IoT hub and get the connection string for it-->
13+
14+
To create a shared access policy that grants **service connect**, **registry read**, and **registry write** permissions and to get a connection string for this policy, follow these steps:
15+
16+
1. In the [Azure portal](https://portal.azure.com), select **Resource groups**. Select the resource group where your hub is located, and then select your hub from the list of resources.
17+
18+
1. On the left-side pane of your hub, select **Shared access policies**.
19+
20+
1. From the top menu above the list of policies, select **Add**.
21+
22+
1. Under **Add a shared access policy**, enter a descriptive name for your policy, such as *serviceAndRegistryReadWrite*. Under **Permissions**, select **Registry write** and **Service connect**, and then select **Create**.
23+
24+
![Show how to add a new shared access policy](./media/iot-hub-include-find-service-regrw-connection-string/iot-hub-add-svc-regrw-policy.png)
25+
26+
1. Select your new policy from the list of policies.
27+
28+
1. Under **Shared access keys**, select the copy icon for the **Connection string -- primary key** and save the value.
29+
30+
![Show how to retrieve the connection string](./media/iot-hub-include-find-service-regrw-connection-string/iot-hub-get-connection-string.png)
31+
32+
For more information about IoT Hub shared access policies and permissions, see [Access control and permissions](../articles/iot-hub/iot-hub-devguide-security.md#access-control-and-permissions).
56.1 KB
Loading
75.1 KB
Loading

0 commit comments

Comments
 (0)