Skip to content

Commit bef4557

Browse files
authored
Merge pull request #102811 from mlottner/master
Send security message updates
2 parents ae0ef56 + 3362058 commit bef4557

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

articles/asc-for-iot/how-to-deploy-edge.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.devlang: na
1414
ms.topic: conceptual
1515
ms.tgt_pltfrm: na
1616
ms.workload: na
17-
ms.date: 10/08/2019
17+
ms.date: 1/30/2020
1818
ms.author: mlottner
1919

2020
---
@@ -166,7 +166,7 @@ If you encounter an issue, container logs are the best way to learn about the st
166166

167167
| Name | IMAGE |
168168
| --- | --- |
169-
| azureiotsecurity | mcr.microsoft.com/ascforiot/azureiotsecurity:1.0.1 |
169+
| azureiotsecurity | mcr.microsoft.com/ascforiot/azureiotsecurity:1.0.2 |
170170
| edgeHub | mcr.microsoft.com/azureiotedge-hub:1.0.8.3 |
171171
| edgeAgent | mcr.microsoft.com/azureiotedge-agent:1.0.1 |
172172

articles/asc-for-iot/how-to-send-security-messages.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.devlang: na
1414
ms.topic: conceptual
1515
ms.tgt_pltfrm: na
1616
ms.workload: na
17-
ms.date: 10/03/2019
17+
ms.date: 1/30/2020
1818
ms.author: mlottner
1919

2020
---
@@ -189,14 +189,21 @@ function SendSecurityMessage(messageContent)​
189189

190190
#### Python API
191191

192+
To use the Python API you need to install the package [azure-iot-device](https://pypi.org/project/azure-iot-device/).
193+
194+
When using the Python API, you can either send the security message through the module or through the device using the unique device or module connection string. When using the following Python script example, with a device, use **IoTHubDeviceClient**, and with a module, use **IoTHubModuleClient**.
195+
192196
```python
197+
from azure.iot.device.aio import IoTHubDeviceClient, IoTHubModuleClient
198+
from azure.iot.device import Message
199+
193200
async def send_security_message_async(message_content):
194201
conn_str = os.getenv("<connection_string>")​
195202
device_client = IoTHubDeviceClient.create_from_connection_string(conn_str)​
196203
await device_client.connect()​
197204
security_message = Message(message_content)​
198205
security_message.set_as_security_message()​
199-
await device_client.send_d2c_message(security_message)​
206+
await device_client.send_message(security_message)​
200207
await device_client.disconnect()
201208
```
202209

0 commit comments

Comments
 (0)