Skip to content

Commit 1466f94

Browse files
committed
Edits
1 parent 84029bb commit 1466f94

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

includes/iot-hub-howto-file-upload-dotnet.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,13 @@ await _deviceClient.CompleteFileUploadAsync(successfulFileUploadCompletionNotifi
9797

9898
You can create a backend service to receive file upload notification messages from IoT Hub.
9999

100-
### Instantiate the service client
101-
102-
```csharp
103-
using Microsoft.Azure.Devices;
104-
static ServiceClient serviceClient;
105-
```
106-
107100
### Add the connection string
108101

109102
Replace the `{IoT Hub connection string}` placeholder value with the IoT Hub connection string.
110103

111104
```csharp
105+
using Microsoft.Azure.Devices;
106+
static ServiceClient serviceClient;
112107
static string connectionString = "{IoT Hub connection string}";
113108
serviceClient = ServiceClient.CreateFromConnectionString(connectionString);
114109
```

includes/iot-hub-howto-file-upload-python.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.date: 07/01/2024
1111
ms.custom: mqtt, devx-track-python, py-fresh-zinc
1212
---
1313

14-
## Install device library
14+
## Install packages
1515

1616
The azure-iot-device library must be installed before calling any related code.
1717

@@ -29,13 +29,12 @@ pip install azure.storage.blob
2929

3030
Follow this procedure to upload a file from a device to IoT hub:
3131

32-
* Connect the client to IoT hub and get storage information
32+
* Connect to IoT hub
33+
* Get Blob Storage information
3334
* Upload the file to Blob Storage
3435
* Notify IoT hub of upload status
3536

36-
### Connect the client to IoT hub and get storage information
37-
38-
The [IoTHubDeviceClient](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient) class contains methods that a device can use to upload a file to IoT Hub.
37+
### Connect to IoT hub
3938

4039
```python
4140
import os
@@ -49,7 +48,7 @@ Call [create_from_connection_string](/python/api/azure-iot-device/azure.iot.devi
4948
For example:
5049

5150
```python
52-
CONNECTION_STRING = "[IoT hub Connection String]"
51+
CONNECTION_STRING = "{IoT hub connection string}"
5352
device_client = IoTHubDeviceClient.create_from_connection_string(CONNECTION_STRING)
5453
```
5554

@@ -60,6 +59,8 @@ Call [connect](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient?
6059
device_client.connect()
6160
```
6261

62+
### Get Blob Storage information
63+
6364
Call [get_storage_info_for_blob](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient?#azure-iot-device-iothubdeviceclient-get-storage-info-for-blob) to get information from an IoT hub about a linked Storage Account. This information includes the hostname, container name, blob name, and a SAS token. The storage info is passed to the `store_blob` function (created in the previous step), so that the `BlobClient` in that function can authenticate with Azure storage. The `get_storage_info_for_blob` method also returns a `correlation_id`, which is used in the notify_blob_upload_status method. The correlation_id is IoT Hub's way of marking which blob you're working on.
6465

6566
```python

0 commit comments

Comments
 (0)