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: articles/iot-hub/iot-hub-csharp-csharp-file-upload.md
+25-44Lines changed: 25 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,6 @@
2
2
title: Upload files from devices to Azure IoT Hub with .NET | Microsoft Docs
3
3
description: How to upload files from a device to the cloud using Azure IoT device SDK for .NET. Uploaded files are stored in an Azure storage blob container.
4
4
author: fsautomata
5
-
manager:
6
5
ms.service: iot-hub
7
6
services: iot-hub
8
7
ms.devlang: csharp
@@ -18,9 +17,10 @@ ms.author: elioda
18
17
This tutorial builds on the code in the [Send Cloud-to-Device messages with IoT Hub](iot-hub-csharp-csharp-c2d.md) tutorial to show you how to use the file upload capabilities of IoT Hub. It shows you how to:
19
18
20
19
- Securely provide a device with an Azure blob URI for uploading a file.
20
+
21
21
- Use the IoT Hub file upload notifications to trigger processing the file in your app back end.
22
22
23
-
The [Get started with IoT Hub](quickstart-send-telemetry-dotnet.md) and [Send Cloud-to-Device messages with IoT Hub](iot-hub-csharp-csharp-c2d.md)tutorials show the basic device-to-cloud and cloud-to-device messaging functionality of IoT Hub. The [Process Device-to-Cloud messages](tutorial-routing.md) tutorial describes a way to reliably store device-to-cloud messages in Azure blob storage. However, in some scenarios you cannot easily map the data your devices send into the relatively small device-to-cloud messages that IoT Hub accepts. For example:
23
+
The [Send telemetry from a device to an IoT hub](quickstart-send-telemetry-dotnet.md) and [Send Cloud-to-Device messages with IoT Hub](iot-hub-csharp-csharp-c2d.md)articles show the basic device-to-cloud and cloud-to-device messaging functionality of IoT Hub. The [Configure Message Routing with IoT Hub](tutorial-routing.md) tutorial describes a way to reliably store device-to-cloud messages in Azure blob storage. However, in some scenarios you cannot easily map the data your devices send into the relatively small device-to-cloud messages that IoT Hub accepts. For example:
24
24
25
25
* Large files that contain images
26
26
* Videos
@@ -32,15 +32,16 @@ These files are typically batch processed in the cloud using tools such as [Azur
32
32
At the end of this tutorial you run two .NET console apps:
33
33
34
34
***SimulatedDevice**, a modified version of the app created in the [Send Cloud-to-Device messages with IoT Hub](iot-hub-csharp-csharp-c2d.md) tutorial. This app uploads a file to storage using a SAS URI provided by your IoT hub.
35
+
35
36
***ReadFileUploadNotification**, which receives file upload notifications from your IoT hub.
36
37
37
38
> [!NOTE]
38
-
> IoT Hub supports many device platforms and languages (including C, Java, and Javascript) through Azure IoT device SDKs. Refer to the [Azure IoT Developer Center] for step-by-step instructions on how to connect your device to Azure IoT Hub.
39
+
> IoT Hub supports many device platforms and languages (including C, Java, and Javascript) through Azure IoT device SDKs. Refer to the [Azure IoT Developer Center](http://azure.microsoft.com/develop/iot) for step-by-step instructions on how to connect your device to Azure IoT Hub.
39
40
40
41
To complete this tutorial, you need the following:
41
42
42
-
* Visual Studio 2015 or Visual Studio 2017
43
-
* An active Azure account. (If you don't have an account, you can create a [free account][lnk-free-trial] in just a couple of minutes.)
43
+
* Visual Studio 2017
44
+
* An active Azure account. (If you don't have an account, you can create a [free account](http://azure.microsoft.com/pricing/free-trial/) in just a couple of minutes.)
@@ -52,7 +53,7 @@ In this section, you modify the device app you created in [Send Cloud-to-Device
52
53
53
54
1. Right-click on the image, and then click **Properties**. Make sure that **Copy to Output Directory** is set to **Copy always**.
54
55
55
-
![][1]
56
+

56
57
57
58
1. In the **Program.cs** file, add the following statements at the top of the file:
58
59
@@ -88,36 +89,36 @@ In this section, you modify the device app you created in [Send Cloud-to-Device
88
89
```
89
90
90
91
> [!NOTE]
91
-
>Forsimplicity's sake, this tutorial does not implement any retry policy. In production code, you should implement retry policies (such as exponential backoff), as suggested in the MSDN article [Transient Fault Handling].
92
+
>Forsimplicity's sake, this tutorial does not implement any retry policy. In production code, you should implement retry policies (such as exponential backoff), as suggested in the MSDN article [Transient Fault Handling](https://msdn.microsoft.com/library/hh680901.aspx).
Thisactiondownloads, installs, andaddsareferencetothe [AzureIoTserviceSDKNuGetpackage](https://www.nuget.org/packages/Microsoft.Azure.Devices/) in the **ReadFileUploadNotification** project.
@@ -157,40 +159,19 @@ Now you are ready to run the applications.
157
159
158
160
1. InVisualStudio, right-clickyoursolution, andselect**SetStartUpprojects**. Select**Multiplestartupprojects**, thenselectthe**Start**actionfor **ReadFileUploadNotification** and **SimulatedDevice**.
159
161
160
-
1. Press **F5**. Both applications should start. You should see the upload completed in one console app and the upload notification message received by the other console app. You can use the [Azure portal] or Visual Studio Server Explorer to check for the presence of the uploaded file in your Azure Storage account.
162
+
2. Press **F5**. Both applications should start. You should see the upload completed in one console app and the upload notification message received by the other console app. You can use the [Azure portal](https://portal.azure.com/) or Visual Studio Server Explorer to check for the presence of the uploaded file in your Azure Storage account.
161
163
162
-
![][50]
164
+

Copy file name to clipboardExpand all lines: articles/iot-hub/iot-hub-csharp-csharp-module-twin-getstarted.md
+28-32Lines changed: 28 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,6 @@
2
2
title: Get started with Azure IoT Hub module identity and module twin (.NET) | Microsoft Docs
3
3
description: Learn how to create module identity and update module twin using IoT SDKs for .NET.
4
4
author: chrissie926
5
-
manager:
6
5
ms.service: iot-hub
7
6
services: iot-hub
8
7
ms.devlang: csharp
@@ -19,15 +18,17 @@ ms.author: menchi
19
18
At the end of this tutorial, you have two .NET console apps:
20
19
21
20
***CreateIdentities**, which creates a device identity, a module identity and associated security key to connect your device and module clients.
21
+
22
22
***UpdateModuleTwinReportedProperties**, which sends updated module twin reported properties to your IoT Hub.
23
23
24
24
> [!NOTE]
25
-
> For information about the Azure IoT SDKs that you can use to build both applications to run on devices, and your solution back end, see [Azure IoT SDKs][lnk-hub-sdks].
25
+
> For information about the Azure IoT SDKs that you can use to build both applications to run on devices, and your solution back end, see [Azure IoT SDKs](iot-hub-devguide-sdks.md).
26
26
27
27
To complete this tutorial, you need the following:
28
28
29
-
* Visual Studio 2015 or Visual Studio 2017.
30
-
* An active Azure account. (If you don't have an account, you can create a [free account][lnk-free-trial] in just a couple of minutes.)
29
+
* Visual Studio 2017.
30
+
31
+
* An active Azure account. (If you don't have an account, you can create a [free account](http://azure.microsoft.com/pricing/free-trial/) in just a couple of minutes.)
@@ -40,20 +41,21 @@ You have now created your IoT hub, and you have the host name and IoT Hub connec
40
41
41
42
In this section, you create a .NET console app on your simulated device that updates the module twin reported properties.
42
43
43
-
1.**Create a Visual Studio project** - In Visual Studio, add a Visual C# Windows Classic Desktop project to the existing solution by using the **Console App (.NET Framework)** project template. Make sure the .NET Framework version is 4.6.1 or later. Name the project **UpdateModuleTwinReportedProperties**.
44
+
1.**Create a Visual Studio project:** In Visual Studio, add a Visual C# Windows Classic Desktop project to the existing solution by using the **Console App (.NET Framework)** project template. Make sure the .NET Framework version is 4.6.1 or later. Name the project **UpdateModuleTwinReportedProperties**.
44
45
45
-
![Create a visual studio project][13]
46
+

46
47
47
-
2.**Install the latest Azure IoT Hub .NET device SDK** - Module identity and module twin is in public preview. It's only availble in the IoT Hub prerelease device SDKs. In Visual Studio, open tools > Nuget package manager > manage Nuget packages for solution. Search Microsoft.Azure.Devices.Client. Make sure you've checked include prerelease check box. Select the latest version and install. Now you have access to all the module features.
48
+
2.**Install the latest Azure IoT Hub .NET device SDK:** Module identity and module twin is in public preview. It's only availble in the IoT Hub prerelease device SDKs. In Visual Studio, open tools > Nuget package manager > manage Nuget packages for solution. Search Microsoft.Azure.Devices.Client. Make sure you've checked include prerelease check box. Select the latest version and install. Now you have access to all the module features.
48
49
49
-
![Install Azure IoT Hub .NET service SDK V1.16.0-preview-005][14]
50
+

50
51
51
-
3.**Get your module connection string** -- now if you login to [Azure portal][lnk-portal]. Navigate to your IoT Hub and click IoT Devices. Find myFirstDevice, open it and you see myFirstModule was successfuly created. Copy the module connection string. It is needed in the next step.
52
+
3.**Get your module connection string** -- now if you login to [Azure portal](https://portal.azure.com/). Navigate to your IoT Hub and click IoT Devices. Find myFirstDevice, open it and you see myFirstModule was successfuly created. Copy the module connection string. It is needed in the next step.
0 commit comments