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-auth-device-cert-python.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,6 @@ ms.date: 12/06/2024
14
14
To connect a device to IoT Hub using an X.509 certificate:
15
15
16
16
1. Use [create_from_x509_certificate](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient?#azure-iot-device-iothubdeviceclient-create-from-x509-certificate) to add the X.509 certificate parameters
17
-
18
17
1. Call [connect](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient?#azure-iot-device-iothubdeviceclient-connect) to connect the device client
19
18
20
19
This example shows certificate input parameter values as local variables for clarity. In a production system, store sensitive input parameters in environment variables or another more secure storage location. For example, use `os.getenv("HOSTNAME")` to read the host name environment variable.
The SDK includes this [file upload receiver sample](https://github.com/Azure/azure-iot-sdk-csharp/blob/86065001a92fedb42877722c6a57ae37e45eed30/iothub/service/samples/getting%20started/FileUploadNotificationReceiverSample/FileUploadNotificationReceiverSample.cs).
Copy file name to clipboardExpand all lines: includes/iot-hub-howto-file-upload-java.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,19 +24,11 @@ This section describes how to upload a file from a device to an IoT hub using th
24
24
25
25
Follow this procedure to upload a file from a device to IoT hub:
26
26
27
-
1. Connect to the device
27
+
1. Connect the device to IoT Hub
28
28
1. Get a SAS URI from IoT hub
29
29
1. Upload the file to Azure Storage
30
30
1. Send file upload status notification to IoT hub
31
31
32
-
### Connection protocol
33
-
34
-
File upload operations always use HTTPS, but [DeviceClient](/java/api/com.microsoft.azure.sdk.iot.device.deviceclient) can define the [IotHubClientProtocol](/java/api/com.microsoft.azure.sdk.iot.device.iothubclientprotocol) for other services like telemetry, device method, and device twin.
A device app can authenticate with IoT Hub using the following methods:
@@ -50,6 +42,12 @@ A device app can authenticate with IoT Hub using the following methods:
50
42
51
43
#### Authenticate using a shared access key
52
44
45
+
File upload operations always use HTTPS, but [DeviceClient](/java/api/com.microsoft.azure.sdk.iot.device.deviceclient) can define the [IotHubClientProtocol](/java/api/com.microsoft.azure.sdk.iot.device.iothubclientprotocol) for other services like telemetry, device method, and device twin.
Instantiate the `DeviceClient` to connect to the device using the device primary connection string.
54
52
55
53
```java
@@ -165,7 +163,7 @@ private static final IotHubServiceClientProtocol protocol =
165
163
166
164
Create the [ServiceClient](/java/api/com.azure.core.annotation.serviceclient) object, supplying the Iot Hub connection string and protocol.
167
165
168
-
To invoke a direct method on a device through IoT Hub, your service needs the **service connect** permission. By default, every IoT Hub is created with a shared access policy named **service** that grants this permission.
166
+
To upload a file on a device to IoT Hub, your service needs the **service connect** permission. By default, every IoT Hub is created with a shared access policy named **service** that grants this permission.
169
167
170
168
As a parameter to the `ServiceClient` constructor, supply the **service** shared access policy. For more information about shared access policies, see [Control access to IoT Hub with shared access signatures](/azure/iot-hub/authenticate-authorize-sas).
Copy file name to clipboardExpand all lines: includes/iot-hub-howto-file-upload-python.md
+1-9Lines changed: 1 addition & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,13 +29,6 @@ pip install azure.storage.blob
29
29
30
30
This section describes how to upload a file from a device to an IoT hub using the [IoTHubDeviceClient](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient) class from the Azure IoT SDK for Python.
31
31
32
-
Follow this procedure to upload a file from a device to IoT hub:
33
-
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
38
-
39
32
### Import libraries
40
33
41
34
```python
@@ -60,8 +53,7 @@ A device app can authenticate with IoT Hub using the following methods:
60
53
61
54
To connect a device to IoT Hub:
62
55
63
-
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
64
-
56
+
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.
65
57
1. Call [connect](/python/api/azure-iot-device/azure.iot.device.iothubdeviceclient?#azure-iot-device-iothubdeviceclient-connect) to connect the device client
0 commit comments