Skip to content

Commit 48f3a2b

Browse files
committed
Integrated in review feedback
1 parent fa94086 commit 48f3a2b

File tree

5 files changed

+47
-46
lines changed

5 files changed

+47
-46
lines changed

articles/iot-hub/how-to-file-upload.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ ms.custom: [amqp, mqtt, "Role: Cloud Development", "Role: IoT Device"]
1616

1717
This article demonstrates how to:
1818

19-
* Use [file upload capabilities of IoT Hub](iot-hub-devguide-file-upload.md) to upload a file to [Azure Blob Storage](../storage/index.yml), using an Azure IoT device and service SDKs.
20-
* Notify IoT Hub that the file was successfully uploaded and create a backend service to receive file upload notifications from IoT Hub.
19+
* Use file upload capabilities of IoT Hub to upload a file to Azure Blob Storage, using an Azure IoT device and service SDKs.
20+
* Notify IoT Hub that the file was successfully uploaded and create a backend service to receive file upload notifications from IoT Hub, using the Azure IoT service SDKs.
2121

2222
In some scenarios, you can't easily map the data your devices send into the relatively small device-to-cloud messages that IoT Hub accepts. The file upload capabilities in IoT Hub enable you to move large or complex data to the cloud. For example:
2323

@@ -33,21 +33,20 @@ This article is meant to complement runnable SDK samples that are referenced fro
3333
For more information, see:
3434

3535
* [Overview of file uploads with IoT Hub](iot-hub-devguide-file-upload.md)
36-
* [Configure IoT Hub file uploads using the Azure portal](iot-hub-configure-file-upload.md)
3736
* [Introduction to Azure Blob Storage](../storage/blobs/storage-blobs-introduction.md)
3837
* [Azure IoT SDKs](iot-hub-devguide-sdks.md)
3938

4039
[!INCLUDE [iot-hub-include-x509-ca-signed-file-upload-support-note](../../includes/iot-hub-include-x509-ca-signed-file-upload-support-note.md)]
4140

4241
## Prerequisites
4342

44-
* **An IoT hub**. Create one using the [Azure portal, CLI, or PowerShell](create-hub.md). Some SDK calls require the IoT Hub connection string, so make a note of the connection string.
43+
* **An IoT hub**. Some SDK calls require the IoT Hub primary connection string, so make a note of the connection string.
4544

46-
* **A registered device**. Register one in the [Azure portal](create-connect-device.md).
45+
* **A registered device**. Some SDK calls require the device primary connection string, so make a note of the connection string.
4746

48-
* IoT Hub **Service Connect** permission - To receive file upload notification messages, your backend service needs the **Service Connect** permission. By default, every IoT Hub is created with a shared access policy named **service** that grants this permission. For more information, see [Connect to an IoT hub](/azure/iot-hub/create-hub?&tabs=portal#connect-to-an-iot-hub).
47+
* IoT Hub **Service Connect** permission - To receive file upload notification messages, your backend service needs the **Service Connect** permission. By default, every IoT Hub is created with a shared access policy named **service** that grants this permission. For more information, see [Connect to an IoT hub](/azure/iot-hub/create-hub?&tabs=portal#connect-to-an-iot-hub).
4948

50-
* Configure file upload in your IoT hub by linking an **Azure Storage account** and **Azure Blob Storage container** associated with IoT Hub. You can configure these using the [Azure portal](/azure/iot-hub/iot-hub-configure-file-upload), [Azure CLI](/azure/iot-hub/iot-hub-configure-file-upload-cli), or [Azure PowerShell](/azure/iot-hub/iot-hub-configure-file-upload-powershell).
49+
* Configure file upload in your IoT hub by linking an **Azure Storage account** and **Azure Blob Storage container**. You can configure these using the [Azure portal](/azure/iot-hub/iot-hub-configure-file-upload), [Azure CLI](/azure/iot-hub/iot-hub-configure-file-upload-cli), or [Azure PowerShell](/azure/iot-hub/iot-hub-configure-file-upload-powershell).
5150

5251
:::zone pivot="programming-language-csharp"
5352

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ This section describes how to upload a file from a device to an IoT hub using th
2424

2525
Follow this procedure to upload a file from a device to IoT hub:
2626

27-
* Connect to IoT hub
28-
* Get a SAS URI from IoT hub
29-
* Upload the file to Azure storage
30-
* Notify IoT hub of the file upload status
27+
1. Connect to IoT hub
28+
1. Get a SAS URI from IoT hub
29+
1. Upload the file to Azure storage
30+
1. Notify IoT hub of the file upload status
3131

3232
### Connect to the device
3333

34-
Call [CreateFromConnectionString](/dotnet/api/microsoft.azure.devices.client.deviceclient.createfromconnectionstring?#microsoft-azure-devices-client-deviceclient-createfromconnectionstring(system-string)) to connect to the device. See the prerequisites section for how to look up the device primary connection string.
34+
Call [CreateFromConnectionString](/dotnet/api/microsoft.azure.devices.client.deviceclient.createfromconnectionstring?#microsoft-azure-devices-client-deviceclient-createfromconnectionstring(system-string)) to connect to the device. Pass the device primary connection string.
3535

3636
`AMQP` is the default transport protocol.
3737

@@ -61,9 +61,9 @@ Uri uploadUri = sasUri.GetBlobUri();
6161

6262
To upload a file to Azure storage:
6363

64-
* Create a [blockBlobClient](/dotnet/api/azure.storage.blobs.specialized.blockblobclient) object, passing a file upload URI
64+
1. Create a [blockBlobClient](/dotnet/api/azure.storage.blobs.specialized.blockblobclient) object, passing a file upload URI
6565

66-
* Use the [UploadAsync](/dotnet/api/azure.storage.blobs.specialized.blockblobclient.uploadasync?#azure-storage-blobs-specialized-blockblobclient-uploadasync(system-io-stream-azure-storage-blobs-models-blobuploadoptions-system-threading-cancellationtoken)) method to upload a file to Blob Storage, passing the SAS URI. You can optionally add Blob upload options and cancellation token parameters.
66+
1. Use the [UploadAsync](/dotnet/api/azure.storage.blobs.specialized.blockblobclient.uploadasync?#azure-storage-blobs-specialized-blockblobclient-uploadasync(system-io-stream-azure-storage-blobs-models-blobuploadoptions-system-threading-cancellationtoken)) method to upload a file to Blob Storage, passing the SAS URI. You can optionally add Blob upload options and cancellation token parameters.
6767

6868
The Azure Blob client always uses HTTPS as the protocol to upload the file to Azure Storage.
6969

@@ -111,10 +111,10 @@ The [ServiceClient](/dotnet/api/microsoft.azure.devices.serviceclient) class con
111111

112112
To receive file upload notification:
113113

114-
* Call [CreateFromConnectionString](/dotnet/api/microsoft.azure.devices.serviceclient.createfromconnectionstring) to connect to IoT hub. Pass the IoT hub connection string. See the prerequisites section for how to look up the IoT hub primary connection string.
115-
* Create a [CancellationToken](/dotnet/api/azure.core.httpmessage.cancellationtoken?#azure-core-httpmessage-cancellationtoken).
116-
* Call [GetFileNotificationReceiver](/dotnet/api/microsoft.azure.devices.serviceclient.getfilenotificationreceiver?#microsoft-azure-devices-serviceclient-getfilenotificationreceiver) to create a notification receiver.
117-
* Use a loop with [ReceiveAsync](/dotnet/api/microsoft.azure.devices.receiver-1.receiveasync?#microsoft-azure-devices-receiver-1-receiveasync(system-threading-cancellationtoken)) to wait for the file upload notification.
114+
1. Call [CreateFromConnectionString](/dotnet/api/microsoft.azure.devices.serviceclient.createfromconnectionstring) to connect to IoT hub. Pass the IoT hub primary connection string.
115+
1. Create a [CancellationToken](/dotnet/api/azure.core.httpmessage.cancellationtoken?#azure-core-httpmessage-cancellationtoken).
116+
1. Call [GetFileNotificationReceiver](/dotnet/api/microsoft.azure.devices.serviceclient.getfilenotificationreceiver?#microsoft-azure-devices-serviceclient-getfilenotificationreceiver) to create a notification receiver.
117+
1. Use a loop with [ReceiveAsync](/dotnet/api/microsoft.azure.devices.receiver-1.receiveasync?#microsoft-azure-devices-receiver-1-receiveasync(system-threading-cancellationtoken)) to wait for the file upload notification.
118118

119119
For example:
120120

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ This section describes how to upload a file from a device to an IoT hub using th
2424

2525
Follow this procedure to upload a file from a device to IoT hub:
2626

27-
* Connect to the device
28-
* Get a SAS URI from IoT hub
29-
* Upload the file to Azure Storage
30-
* Send file upload status notification to IoT hub
27+
1. Connect to the device
28+
1. Get a SAS URI from IoT hub
29+
1. Upload the file to Azure Storage
30+
1. Send file upload status notification to IoT hub
3131

3232
### Connection protocol
3333

@@ -39,7 +39,7 @@ IotHubClientProtocol protocol = IotHubClientProtocol.MQTT;
3939

4040
### Connect to the device
4141

42-
Instantiate the `DeviceClient` to connect to the device using the device primary connection string. See the prerequisites section for how to look up the device primary connection string.
42+
Instantiate the `DeviceClient` to connect to the device using the device primary connection string.
4343

4444
```java
4545
String connString = "{IoT hub connection string}";
@@ -118,16 +118,16 @@ You can create a backend application to receive file upload notifications.
118118

119119
To create a file upload notification application:
120120

121-
* Connect to the IoT hub service client
122-
* Check for a file upload notification
121+
1. Connect to the IoT hub service client
122+
1. Check for a file upload notification
123123

124124
The [ServiceClient](/java/api/com.azure.core.annotation.serviceclient) class contains methods that services can use to receive file upload notifications.
125125

126126
### Connect to the IoT hub service client
127127

128128
Create a `IotHubServiceClientProtocol` object. The connection uses the `AMQPS` protocol.
129129

130-
Call `createFromConnectionString` to connect to IoT hub. Pass the IoT hub primary connection string. See the prerequisites section for how to look up the IoT hub primary connection string.
130+
Call `createFromConnectionString` to connect to IoT hub. Pass the IoT hub primary connection string.
131131

132132
```java
133133
private static final String connectionString = "{IoT hub primary connection string}";
@@ -139,9 +139,9 @@ ServiceClient sc = ServiceClient.createFromConnectionString(connectionString, pr
139139

140140
To check for file upload status:
141141

142-
* Create a [getFileUploadNotificationReceiver](/java/api/com.microsoft.azure.sdk.iot.service.fileuploadnotificationreceiver) object
143-
* Use [open](/java/api/com.microsoft.azure.sdk.iot.service.fileuploadnotificationreceiver?#com-microsoft-azure-sdk-iot-service-fileuploadnotificationreceiver-open()) to connect to IoT hub
144-
* Call [receive](/java/api/com.microsoft.azure.sdk.iot.service.fileuploadnotificationreceiver?#com-microsoft-azure-sdk-iot-service-fileuploadnotificationreceiver-receive()) to check for the file upload status. This method returns a [fileUploadNotification](/java/api/com.microsoft.azure.sdk.iot.service.fileuploadnotification) object. If an upload notice is received, you can view upload status fields using [fileUploadNotification](/java/api/com.microsoft.azure.sdk.iot.service.fileuploadnotification) methods.
142+
1. Create a [getFileUploadNotificationReceiver](/java/api/com.microsoft.azure.sdk.iot.service.fileuploadnotificationreceiver) object
143+
1. Use [open](/java/api/com.microsoft.azure.sdk.iot.service.fileuploadnotificationreceiver?#com-microsoft-azure-sdk-iot-service-fileuploadnotificationreceiver-open()) to connect to IoT hub
144+
1. Call [receive](/java/api/com.microsoft.azure.sdk.iot.service.fileuploadnotificationreceiver?#com-microsoft-azure-sdk-iot-service-fileuploadnotificationreceiver-receive()) to check for the file upload status. This method returns a [fileUploadNotification](/java/api/com.microsoft.azure.sdk.iot.service.fileuploadnotification) object. If an upload notice is received, you can view upload status fields using [fileUploadNotification](/java/api/com.microsoft.azure.sdk.iot.service.fileuploadnotification) methods.
145145

146146
For example:
147147

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ The [azure-iot-device](/javascript/api/azure-iot-device) package contains object
3434

3535
Follow this procedure for uploading a file from a device to IoT hub:
3636

37-
* Get Blob shared access signatures
38-
* Upload the file to Azure Storage
39-
* Send file upload status notification to IoT hub
37+
1. Get Blob shared access signatures
38+
1. Upload the file to Azure Storage
39+
1. Send file upload status notification to IoT hub
4040

4141
### Create modules
4242

@@ -131,18 +131,18 @@ You can create a backend application to check the IoT hub service client for dev
131131

132132
To create a file upload notification application:
133133

134-
* Connect to the IoT hub service client
135-
* Check for a file upload notification
134+
1. Connect to the IoT hub service client
135+
1. Check for a file upload notification
136136

137137
### Connect to the IoT hub service client
138138

139139
The [ServiceClient](/javascript/api/azure-iothub/client) class contains methods that services can use to receive file upload notifications.
140140

141-
Connect to IoT hub using [fromConnectionString](/javascript/api/azure-iothub/client?#azure-iothub-client-fromconnectionstring). See the prerequisites section for how to look up the IoT hub primary connection string.
141+
Connect to IoT hub using [fromConnectionString](/javascript/api/azure-iothub/client?#azure-iothub-client-fromconnectionstring). Pass the IoT hub primary connection string.
142142

143143
```javascript
144144
const Client = require('azure-iothub').Client;
145-
const connectionString = "{IoT hub connection string}";
145+
const connectionString = "{IoT hub primary connection string}";
146146
const serviceClient = Client.fromConnectionString(connectionString);
147147
```
148148

@@ -161,8 +161,8 @@ serviceClient.open(function (err) {
161161
162162
To check for file upload notifications:
163163
164-
* Call [getFileNotificationReceiver](/javascript/api/azure-iothub/client?#azure-iothub-client-getfilenotificationreceiver). Supply the name of a file upload callback method that are called when notification messages are received.
165-
* Process file upload notifications in the callback method.
164+
1. Call [getFileNotificationReceiver](/javascript/api/azure-iothub/client?#azure-iothub-client-getfilenotificationreceiver). Supply the name of a file upload callback method that are called when notification messages are received.
165+
1. Process file upload notifications in the callback method.
166166
167167
This example sets up a `receiveFileUploadNotification` notification callback receiver. The receiver interprets the file upload status information and prints a status message to the console.
168168

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ This section describes how to upload a file from a device to an IoT hub using th
3131

3232
Follow this procedure to upload a file from a device to IoT hub:
3333

34-
* Connect to the device
35-
* Get Blob Storage information
36-
* Upload the file to Blob Storage
37-
* Notify IoT hub of upload status
34+
1. Connect to the device
35+
1. Get Blob Storage information
36+
1. Upload the file to Blob Storage
37+
1. Notify IoT hub of upload status
3838

3939
### Import libraries
4040

@@ -47,9 +47,11 @@ from azure.storage.blob import BlobClient
4747

4848
### Connect to the device
4949

50-
Call [create_from_connection_string](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient?#azure-iot-device-iothubdeviceclient-create-from-connection-string) to add the device primary connection string. See the prerequisites section for how to look up the device primary connection string.
50+
To connect to the device:
5151

52-
Then call [connect](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient?#azure-iot-device-iothubdeviceclient-connect) to connect the device client.
52+
1. Call [create_from_connection_string](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient?#azure-iot-device-iothubdeviceclient-create-from-connection-string) to add the device primary connection string.
53+
54+
1. Call [connect](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient?#azure-iot-device-iothubdeviceclient-connect) to connect the device client.
5355

5456
For example:
5557

@@ -77,8 +79,8 @@ blob_info = device_client.get_storage_info_for_blob(blob_name)
7779

7880
To upload a file into Blob Storage:
7981

80-
* Use [from_blob_url](/python/api/azure-storage-blob/azure.storage.blob.blobclient?#azure-storage-blob-blobclient-from-blob-url) to create a [BlobClient](/python/api/azure-storage-blob/azure.storage.blob.blobclient?#azure-storage-blob-blobclient-from-blob-url) object from a blob URL.
81-
* Call [upload_blob](/python/api/azure-storage-blob/azure.storage.blob.blobclient?#azure-storage-blob-blobclient-upload-blob) to upload the file into the Blob Storage.
82+
1. Use [from_blob_url](/python/api/azure-storage-blob/azure.storage.blob.blobclient?#azure-storage-blob-blobclient-from-blob-url) to create a [BlobClient](/python/api/azure-storage-blob/azure.storage.blob.blobclient?#azure-storage-blob-blobclient-from-blob-url) object from a blob URL.
83+
1. Call [upload_blob](/python/api/azure-storage-blob/azure.storage.blob.blobclient?#azure-storage-blob-blobclient-upload-blob) to upload the file into the Blob Storage.
8284

8385
This example parses the `blob_info` structure to create a URL that it uses to initialize an [BlobClient](/python/api/azure-storage-blob/azure.storage.blob.blobclient). Then it calls `upload_blob` to upload the file into Blob Storage.
8486

0 commit comments

Comments
 (0)