You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: includes/iot-hub-howto-file-upload-dotnet.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,12 +31,12 @@ Follow this procedure to upload a file from a device to IoT hub:
31
31
32
32
### Connect to IoT hub
33
33
34
-
Call [CreateFromConnectionString](/dotnet/api/microsoft.azure.devices.client.deviceclient.createfromconnectionstring?#microsoft-azure-devices-client-deviceclient-createfromconnectionstring(system-string))method to connect to IoT hub. See the prerequisites section for how to look up the IoT hub 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 IoT hub. See the prerequisites section for how to look up the device primary connection string.
@@ -63,15 +63,15 @@ To upload a file to Azure storage:
63
63
64
64
* Create a [blockBlobClient](/dotnet/api/azure.storage.blobs.specialized.blockblobclient) object, passing a file upload URI
65
65
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
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.
67
67
68
68
The Azure Blob client always uses HTTPS as the protocol to upload the file to Azure Storage.
69
69
70
70
In this example, `BlockBlobClient` is passed the SAS URI to create an Azure Storage block Blob client and uploads the file:
@@ -111,9 +111,12 @@ The [ServiceClient](/dotnet/api/microsoft.azure.devices.serviceclient) class con
111
111
112
112
To receive file upload notification:
113
113
114
-
* Create a [CancellationToken](/dotnet/api/azure.core.httpmessage.cancellationtoken?#azure-core-httpmessage-cancellationtoken)
115
-
* Call [GetFileNotificationReceiver](/dotnet/api/microsoft.azure.devices.serviceclient.getfilenotificationreceiver?#microsoft-azure-devices-serviceclient-getfilenotificationreceiver) to create a notification receiver
116
-
* 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
+
* Call [CreateFromConnectionString](/dotnet/api/microsoft.azure.devices.serviceclient.createfromconnectionstring?view=azure-dotnet&branch=main) 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.
Instantiate the `DeviceClient` to connect to IoT hub using the IoT hub primary connection string. See the prerequisites section for how to look up the IoT hub primary connection string.
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.
43
43
44
44
```java
45
45
String connString ="{IoT hub connection string}";
@@ -127,10 +127,10 @@ The [ServiceClient](/java/api/com.azure.core.annotation.serviceclient) class con
127
127
128
128
Create a `IotHubServiceClientProtocol` object. The connection uses the `AMQPS` protocol.
129
129
130
-
Call `createFromConnectionString` to connect to IoT hub.
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.
131
131
132
132
```java
133
-
privatestaticfinalString connectionString ="{IoT hub service connection string}";
Copy file name to clipboardExpand all lines: includes/iot-hub-howto-file-upload-node.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ const path = require('path');
51
51
52
52
### Get a SAS URI from IoT hub
53
53
54
-
Use [getBlobSharedAccessSignature](/javascript/api/azure-iot-device/client?#azure-iot-device-client-getblobsharedaccesssignature) to get the linked storage account SAS token from IoT hub.
54
+
Use [getBlobSharedAccessSignature](/javascript/api/azure-iot-device/client?#azure-iot-device-client-getblobsharedaccesssignature) to get the linked storage account SAS token from IoT hub. As described in prerequisites, the IoT hub is linked to the Blob Storage.
Copy file name to clipboardExpand all lines: includes/iot-hub-howto-file-upload-python.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ This section describes how to upload a file from a device to an IoT hub using th
31
31
32
32
Follow this procedure to upload a file from a device to IoT hub:
33
33
34
-
* Connect to IoT hub
34
+
* Connect to the device
35
35
* Get Blob Storage information
36
36
* Upload the file to Blob Storage
37
37
* Notify IoT hub of upload status
@@ -45,17 +45,17 @@ from azure.core.exceptions import AzureError
45
45
from azure.storage.blob import BlobClient
46
46
```
47
47
48
-
### Connect to IoT hub
48
+
### Connect to the device
49
49
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 IoT hub primary connection string. See the prerequisites section for how to look up the IoT hub primary connection string.
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.
51
51
52
-
Then call [connect](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient?#azure-iot-device-iothubdeviceclient-connect) to connect the device client to an Azure IoT hub.
52
+
Then call [connect](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient?#azure-iot-device-iothubdeviceclient-connect) to connect the device client.
0 commit comments