Skip to content

Commit 92a1970

Browse files
committed
Edits
1 parent 6717097 commit 92a1970

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
lines changed

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ This how-to contains two sections:
2020

2121
## Upload a file from a device application
2222

23-
Follow this procedure to upload a file from a device to IoT Hub:
23+
Follow this procedure to upload a file from a device to IoT hub:
2424

25-
* Connect to IoT Hub
26-
* Get a SAS URI from IoT Hub
25+
* Connect to IoT hub
26+
* Get a SAS URI from IoT hub
2727
* Upload the file to Azure storage
2828
* Notify IoT hub of the file upload status
2929

30-
### Connect to IoT Hub
30+
### Connect to IoT hub
3131

32-
Supply the IoT Hub primary connection string to [DeviceClient](/dotnet/api/microsoft.azure.devices.client.deviceclient) using the [CreateFromConnectionString](/dotnet/api/microsoft.azure.devices.client.deviceclient.createfromconnectionstring?#microsoft-azure-devices-client-deviceclient-createfromconnectionstring(system-string)) method. `AMQP` is the default transport protocol.
32+
Supply the IoT hub primary connection string to [DeviceClient](/dotnet/api/microsoft.azure.devices.client.deviceclient) using the [CreateFromConnectionString](/dotnet/api/microsoft.azure.devices.client.deviceclient.createfromconnectionstring?#microsoft-azure-devices-client-deviceclient-createfromconnectionstring(system-string)) method. `AMQP` is the default transport protocol.
3333

3434
``` csharp
35-
static string connectionString = "{IoT Hub primary connection string}";
35+
static string connectionString = "{IoT hub primary connection string}";
3636
deviceClient = DeviceClient.CreateFromConnectionString(connectionString);
3737
```
3838

39-
### Get a SAS URI from IoT Hub
39+
### Get a SAS URI from IoT hub
4040

4141
Call [GetFileUploadSasUriAsync](/dotnet/api/microsoft.azure.devices.client.deviceclient.getfileuploadsasuriasync) to get a file upload details. The SAS URI is used in the next step to upload a file from a device to Blob Storage.
4242

@@ -72,9 +72,9 @@ await blockBlobClient.UploadAsync(fileStreamSource, new BlobUploadOptions());
7272

7373
### Notify IoT hub of the file upload status
7474

75-
Use [CompleteFileUploadAsync](/dotnet/api/microsoft.azure.devices.client.deviceclient.completefileuploadasync) to notify IoT Hub that the device client completed the upload, passing a [FileUploadCompletionNotification](/dotnet/api/microsoft.azure.devices.client.transport.fileuploadcompletionnotification) object. The `IsSuccess` flag indicates whether or not the upload was successful. After being notified, IoT Hub will release resources associated with the upload (the SAS URI).
75+
Use [CompleteFileUploadAsync](/dotnet/api/microsoft.azure.devices.client.deviceclient.completefileuploadasync) to notify IoT hub that the device client completed the upload, passing a [FileUploadCompletionNotification](/dotnet/api/microsoft.azure.devices.client.transport.fileuploadcompletionnotification) object. The `IsSuccess` flag indicates whether or not the upload was successful. After being notified, IoT hub will release resources associated with the upload (the SAS URI).
7676

77-
If file upload notifications are enabled, IoT Hub sends a file upload notification message to backend services that are configured for file upload notification.
77+
If file upload notifications are enabled, IoT hub sends a file upload notification message to backend services that are configured for file upload notification.
7878

7979
```csharp
8080
var successfulFileUploadCompletionNotification = new FileUploadCompletionNotification
@@ -97,7 +97,7 @@ await _deviceClient.CompleteFileUploadAsync(successfulFileUploadCompletionNotifi
9797

9898
## Receive a file upload notification in a backend application
9999

100-
You can create a backend service to receive file upload notification messages from IoT Hub.
100+
You can create a backend service to receive file upload notification messages from IoT hub.
101101

102102
The [ServiceClient](/dotnet/api/microsoft.azure.devices.serviceclient) class contains methods that services can use to receive file upload notifications.
103103

@@ -110,7 +110,7 @@ To receive file upload notification:
110110
```csharp
111111
using Microsoft.Azure.Devices;
112112
static ServiceClient serviceClient;
113-
static string connectionString = "{IoT Hub connection string}";
113+
static string connectionString = "{IoT hub connection string}";
114114
serviceClient = ServiceClient.CreateFromConnectionString(connectionString);
115115

116116
// Define the cancellation token

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ This how-to contains two sections:
2020

2121
## Upload a file from a device application
2222

23-
Follow this procedure to upload a file from a device to IoT Hub:
23+
Follow this procedure to upload a file from a device to IoT hub:
2424

25-
* Connect to IoT Hub
26-
* Get a SAS URI from IoT Hub
25+
* Connect to IoT hub
26+
* Get a SAS URI from IoT hub
2727
* Upload the file to Azure Storage
28-
* Send file upload status notification to IoT Hub
28+
* Send file upload status notification to IoT hub
2929

3030
### Connection protocol
3131

@@ -35,16 +35,16 @@ File upload operations always use HTTPS, but [DeviceClient](/java/api/com.micros
3535
IotHubClientProtocol protocol = IotHubClientProtocol.MQTT;
3636
```
3737

38-
### Connect to IoT Hub
38+
### Connect to IoT hub
3939

40-
Instantiate the DeviceClient to connect to IoT hub using the Iot hub primary connection string and protocol parameters.
40+
Instantiate the `DeviceClient` to connect to IoT hub using the IoT hub primary connection string and protocol parameters.
4141

4242
```java
4343
String connString = "{IoT hub connection string}";
4444
DeviceClient client = new DeviceClient(connString, protocol);
4545
```
4646

47-
### Get a SAS URI from Iot Hub
47+
### Get a SAS URI from IoT hub
4848

4949
Call [getFileUploadSasUri](/java/api/com.microsoft.azure.sdk.iot.device.deviceclient?#com-microsoft-azure-sdk-iot-device-deviceclient-getfileuploadsasuri(com-microsoft-azure-sdk-iot-deps-serializer-fileuploadsasurirequest)) to obtain a [FileUploadSasUriResponse](/java/api/com.microsoft.azure.sdk.iot.deps.serializer.fileuploadsasuriresponse) object.
5050

@@ -62,7 +62,7 @@ For example:
6262
```java
6363
FileUploadSasUriResponse sasUriResponse = client.getFileUploadSasUri(new FileUploadSasUriRequest(file.getName()));
6464

65-
System.out.println("Successfully got SAS URI from IoT Hub");
65+
System.out.println("Successfully got SAS URI from IoT hub");
6666
System.out.println("Correlation Id: " + sasUriResponse.getCorrelationId());
6767
System.out.println("Container name: " + sasUriResponse.getContainerName());
6868
System.out.println("Blob name: " + sasUriResponse.getBlobName());
@@ -87,13 +87,13 @@ String fullFileName = "Path of the file to upload";
8787
blobClient.uploadFromFile(fullFileName);
8888
```
8989

90-
## Send file upload status notification to IoT Hub
90+
## Send file upload status notification to IoT hub
9191

9292
Send an upload status notification to IoT hub after a file upload attempt.
9393

9494
Create a [FileUploadCompletionNotification](/java/api/com.microsoft.azure.sdk.iot.deps.serializer.fileuploadcompletionnotification?#com-microsoft-azure-sdk-iot-deps-serializer-fileuploadcompletionnotification-fileuploadcompletionnotification(java-lang-string-java-lang-boolean)) object. Pass the `correlationId` and `isSuccess` file upload success status. Pass an `isSuccess` `true` value when file upload was successful, `false` when not.
9595

96-
`FileUploadCompletionNotification` must be called even when the file upload fails. IoT Hub has a fixed number of SAS URI allowed to be active at any given time. Once you're done with the file upload, you should free your SAS URI so that other SAS URI can be generated. If a SAS URI isn't freed through this API, then it frees itself eventually based on how long SAS URI are configured to live on an IoT Hub.
96+
`FileUploadCompletionNotification` must be called even when the file upload fails. IoT hub has a fixed number of SAS URI allowed to be active at any given time. Once you're done with the file upload, you should free your SAS URI so that other SAS URI can be generated. If a SAS URI isn't freed through this API, then it frees itself eventually based on how long SAS URI are configured to live on an IoT hub.
9797

9898
This example passes a successful status.
9999

@@ -116,7 +116,7 @@ You can create a backend application to receive file upload notifications.
116116

117117
To create a file upload notification application:
118118

119-
* Connect to the IoT Hub service client
119+
* Connect to the IoT hub service client
120120
* Check for a file upload notification
121121

122122
The [ServiceClient](/java/api/com.azure.core.annotation.serviceclient) class contains methods that services can use to receive file upload notifications.
@@ -138,7 +138,7 @@ ServiceClient sc = ServiceClient.createFromConnectionString(connectionString, pr
138138
To check for file upload status:
139139

140140
* Create a [getFileUploadNotificationReceiver](/java/api/com.microsoft.azure.sdk.iot.service.fileuploadnotificationreceiver) object
141-
* Use [open](/java/api/com.microsoft.azure.sdk.iot.service.fileuploadnotificationreceiver?#com-microsoft-azure-sdk-iot-service-fileuploadnotificationreceiver-open()) to connect to IoT Hub
141+
* Use [open](/java/api/com.microsoft.azure.sdk.iot.service.fileuploadnotificationreceiver?#com-microsoft-azure-sdk-iot-service-fileuploadnotificationreceiver-open()) to connect to IoT hub
142142
* 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.
143143

144144
For example:

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ npm install azure-iot-device azure-iot-device-mqtt @azure/storage-blob --save
3030

3131
The [azure-iot-device](/javascript/api/azure-iot-device) package contains objects that interface with IoT devices.
3232

33-
Follow this procedure for uploading a file from a device to IoT Hub:
33+
Follow this procedure for uploading a file from a device to IoT hub:
3434

3535
* Get Blob shared access signatures
3636
* Upload the file to Azure Storage
37-
* Send file upload status notification to IoT Hub
37+
* Send file upload status notification to IoT hub
3838

3939
### Create modules
4040

@@ -47,9 +47,9 @@ const errors = require('azure-iot-common').errors;
4747
const path = require('path');
4848
```
4949

50-
### Get a SAS URI from IoT Hub
50+
### Get a SAS URI from IoT hub
5151

52-
Use [getBlobSharedAccessSignature](/javascript/api/azure-iot-device/client?#azure-iot-device-client-getblobsharedaccesssignature) to get the linked storage account SAS token from IoT Hub.
52+
Use [getBlobSharedAccessSignature](/javascript/api/azure-iot-device/client?#azure-iot-device-client-getblobsharedaccesssignature) to get the linked storage account SAS token from IoT hub.
5353

5454
For example:
5555

@@ -71,7 +71,7 @@ To upload a file from a device to IoT hub:
7171
2. Construct the blob URL
7272
3. Create a [BlockBlobClient](/javascript/api/@azure/storage-blob/blockblobclient) for file upload to Blob Storage
7373
4. Call [uploadFile](/javascript/api/@azure/storage-blob/blockblobclient?#@azure-storage-blob-blockblobclient-uploadfile) to upload the file to Blob Storage
74-
5. Call [notifyBlobUploadStatus](/javascript/api/azure-iot-device/client?#azure-iot-device-client-notifyblobuploadstatus) to notify IoT Hub that the upload succeeded or failed
74+
5. Call [notifyBlobUploadStatus](/javascript/api/azure-iot-device/client?#azure-iot-device-client-notifyblobuploadstatus) to notify IoT hub that the upload succeeded or failed
7575

7676
For example:
7777

@@ -107,7 +107,7 @@ console.log('uploadStreamToBlockBlob success');
107107
statusCode = uploadStatus._response.status;
108108
statusDescription = uploadStatus._response.bodyAsText;
109109

110-
// Notify IoT Hub of upload to blob status (success)
110+
// Notify IoT hub of upload to blob status (success)
111111
console.log('notifyBlobUploadStatus success');
112112
}
113113
catch (err) {
@@ -125,7 +125,7 @@ await client.notifyBlobUploadStatus(blobInfo.correlationId, isSuccess, statusCod
125125

126126
## Receive file upload notification in a backend application
127127

128-
You can create a backend application to check the IoT Hub service client for device file upload notifications.
128+
You can create a backend application to check the IoT hub service client for device file upload notifications.
129129

130130
To create a file upload notification application:
131131

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ try:
9696
return (True, result)
9797

9898
except FileNotFoundError as ex:
99-
# catch file not found and add an HTTP status code to return in notification to IoT Hub
99+
# catch file not found and add an HTTP status code to return in notification to IoT hub
100100
ex.status_code = 404
101101
return (False, ex)
102102

@@ -107,7 +107,7 @@ except AzureError as ex:
107107

108108
### Notify IoT hub of upload status
109109

110-
Use [notify_blob_upload_status](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient?#azure-iot-device-iothubdeviceclient-notify-blob-upload-status) to notify IoT hub of the status of the Blob Storage operation. Pass the `correlation_id` obtained by the `get_storage_info_for_blob` method. The `correlation_id` is used by IoT Hub to notify any service that might be listening for a notification regarding the status of the file upload task.
110+
Use [notify_blob_upload_status](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient?#azure-iot-device-iothubdeviceclient-notify-blob-upload-status) to notify IoT hub of the status of the Blob Storage operation. Pass the `correlation_id` obtained by the `get_storage_info_for_blob` method. The `correlation_id` is used by IoT hub to notify any service that might be listening for a notification regarding the status of the file upload task.
111111

112112
This example notifies IoT hub of a successful file upload:
113113

0 commit comments

Comments
 (0)