|
| 1 | +--- |
| 2 | +title: Tutorial to filter, analyze data for advanced deployment with compute on Azure Data Box Edge | Microsoft Docs |
| 3 | +description: Learn how to configure compute role on Data Box Edge and use it to transform data for advanced deployment flow before sending to Azure. |
| 4 | +services: databox |
| 5 | +author: alkohli |
| 6 | + |
| 7 | +ms.service: databox |
| 8 | +ms.subservice: edge |
| 9 | +ms.topic: tutorial |
| 10 | +ms.date: 05/13/2019 |
| 11 | +ms.author: alkohli |
| 12 | +Customer intent: As an IT admin, I need to understand how to configure compute on Data Box Edge for advanced deployment flow so I can use it to transform the data before sending it to Azure. |
| 13 | +--- |
| 14 | + |
| 15 | +# Tutorial: Transform data with Azure Data Box Edge for advanced deployment flow |
| 16 | + |
| 17 | +This tutorial describes how to configure a compute role for an advanced deployment flow on your Azure Data Box Edge device. After you configure the compute role, Data Box Edge can transform data before sending it to Azure. |
| 18 | + |
| 19 | +Compute can be configured for simple or advanced deployment flow on your device. |
| 20 | + |
| 21 | +| | Simple deployment | Advanced deployment | |
| 22 | +|------------------|--------------------------------------------------|---------------------------------------| |
| 23 | +| Intended for | IT administrators | Developers | |
| 24 | +| Type | Use Data Box Edge service to deploy modules | Use IoT Hub service to deploy modules | |
| 25 | +| Modules deployed | Single | Chained or multiple modules | |
| 26 | + |
| 27 | + |
| 28 | +This procedure can take around 20 to 30 minutes to complete. |
| 29 | + |
| 30 | +In this tutorial, you learn how to: |
| 31 | + |
| 32 | +> [!div class="checklist"] |
| 33 | +> * Configure compute |
| 34 | +> * Add shares |
| 35 | +> * Add a trigger |
| 36 | +> * Add a compute module |
| 37 | +> * Verify data transform and transfer |
| 38 | +
|
| 39 | + |
| 40 | +## Prerequisites |
| 41 | + |
| 42 | +Before you set up a compute role on your Data Box Edge device, make sure that: |
| 43 | + |
| 44 | +- You've activated your Data Box Edge device as described in [Connect, set up, and activate Azure Data Box Edge](data-box-edge-deploy-connect-setup-activate.md). |
| 45 | + |
| 46 | + |
| 47 | +## Configure compute |
| 48 | + |
| 49 | +To configure compute on your Data Box Edge, you'll create an IoT Hub resource. |
| 50 | + |
| 51 | +1. In the Azure portal of your Data Box Edge resource, go to **Overview**. In the right-pane, on the **Compute** tile, select **Get started**. |
| 52 | + |
| 53 | +  |
| 54 | + |
| 55 | +2. On the **Configure Edge compute** tile, select **Configure compute**. |
| 56 | + |
| 57 | +  |
| 58 | + |
| 59 | +3. On the **Configure Edge compute** blade, input the following: |
| 60 | + |
| 61 | + |
| 62 | + |Field |Value | |
| 63 | + |---------|---------| |
| 64 | + |IoT Hub | Choose from **New** or **Existing**. <br> By default, a Standard tier (S1) is used to create an IoT resource. To use a free tier IoT resource, create one and then select the existing resource. <br> In each case, the IoT Hub resource uses the same subscription and resource group that is used by the Data Box Edge resource. | |
| 65 | + |Name |Enter a name for your IoT Hub resource. | |
| 66 | + |
| 67 | +  |
| 68 | + |
| 69 | +4. Select **Create**. The IoT Hub resource creation takes a couple minutes. After the IoT Hub resource is created, the **Configure Edge compute** tile updates to show the compute configuration. To confirm that the Edge compute role has been configured, select **View config** on the **Configure compute** tile. |
| 70 | + |
| 71 | +  |
| 72 | + |
| 73 | + When the Edge compute role is set up on the Edge device, it creates two devices: an IoT device and an IoT Edge device. Both devices can be viewed in the IoT Hub resource. An IoT Edge Runtime is also running on this IoT Edge device. |
| 74 | + |
| 75 | + At this point, only the Linux platform is available for your IoT Edge device. |
| 76 | + |
| 77 | + |
| 78 | +## Add shares |
| 79 | + |
| 80 | +For the advanced deployment in this tutorial, you'll need two shares: one Edge share and another Edge local share. |
| 81 | + |
| 82 | +1. Add an Edge share on the device by doing the following steps: |
| 83 | + |
| 84 | + 1. In your Data Box Edge resource, go to **Edge compute > Get started**. |
| 85 | + 2. On the **Add share(s)** tile, select **Add**. |
| 86 | + 3. On the **Add share** blade, provide the share name and select the share type. |
| 87 | + 4. To mount the Edge share, select the check box for **Use the share with Edge compute**. |
| 88 | + 5. Select the **Storage account**, **Storage service**, an existing user, and then select **Create**. |
| 89 | + |
| 90 | +  |
| 91 | + |
| 92 | + <!--If you created a local NFS share, use the following remote sync (rsync) command option to copy files onto the share: |
| 93 | +
|
| 94 | + `rsync <source file path> < destination file path>` |
| 95 | +
|
| 96 | + For more information about the rsync command, go to [Rsync documentation](https://www.computerhope.com/unix/rsync.htm).--> |
| 97 | + |
| 98 | + After the Edge share is created, you'll receive a successful creation notification. The share list is updated to reflect the new share. |
| 99 | + |
| 100 | +2. Add an Edge local share on the Edge device by repeating all the steps in the preceding step and selecting the check box for **Configure as Edge local share**. The data in the local share stays on the device. |
| 101 | + |
| 102 | +  |
| 103 | + |
| 104 | +3. On the **Shares** blade, you see the updated list of shares. |
| 105 | + |
| 106 | +  |
| 107 | + |
| 108 | +4. To view the properties of the newly created local share, select the share from the list. In the **Local mount point for Edge compute modules** box, copy the value corresponding to this share. |
| 109 | + |
| 110 | + You'll use this local mount point when you deploy the module. |
| 111 | + |
| 112 | +  |
| 113 | + |
| 114 | +5. To view the properties of the Edge share that you created, select the share from the list. In the **Local mount point for Edge compute modules** box, copy the value corresponding to this share. |
| 115 | + |
| 116 | + You'll use this local mount point when you deploy the module. |
| 117 | + |
| 118 | +  |
| 119 | + |
| 120 | + |
| 121 | +## Add a trigger |
| 122 | + |
| 123 | +1. Go to **Edge compute > Triggers**. Select **+ Add trigger**. |
| 124 | + |
| 125 | +  |
| 126 | + |
| 127 | +2. In the **Add trigger** blade, input the following values. |
| 128 | + |
| 129 | + |Field |Value | |
| 130 | + |---------|---------| |
| 131 | + |Trigger name | A unique name for your trigger. | |
| 132 | + |Trigger type | Select **File** trigger. A file trigger fires whenever a file event occurs such as a file is written to the input share. A scheduled trigger on the other hand, fires up based on a schedule defined by you. For this example, we need a file trigger. | |
| 133 | + |Input share | Select an input share. The Edge local share is the input share in this case. The module used here moves files from the Edge local share to an Edge share where they are uploaded into the cloud. | |
| 134 | + |
| 135 | +  |
| 136 | + |
| 137 | +3. You are notified after the trigger is created. The list of triggers is updated to display the newly created trigger. Select the trigger you just created. |
| 138 | + |
| 139 | +  |
| 140 | + |
| 141 | +4. Copy and save the sample route. You will modify this sample route and use it later in the IoT Hub. |
| 142 | + |
| 143 | + `"sampleroute": "FROM /* WHERE topic = 'mydbesmbedgelocalshare1' INTO BrokeredEndpoint(\"/modules/modulename/inputs/input1\")"` |
| 144 | + |
| 145 | +  |
| 146 | + |
| 147 | +## Add a module |
| 148 | + |
| 149 | +There are no custom modules on this Edge device. You could add a custom or a pre-built module. To learn how to create a custom module, go to [Develop a C# module for your Data Box Edge device](data-box-edge-create-iot-edge-module.md). |
| 150 | + |
| 151 | +In this section, you add a custom module to the IoT Edge device that you created in [Develop a C# module for your Data Box Edge](data-box-edge-create-iot-edge-module.md). This custom module takes files from an Edge local share on the Edge device and moves them to an Edge (cloud) share on the device. The cloud share then pushes the files to the Azure storage account that's associated with the cloud share. |
| 152 | + |
| 153 | +1. Go to **Edge compute > Get started**. On the **Add modules** tile, select the scenario type as **advanced**. Select **Go to IoT Hub**. |
| 154 | + |
| 155 | +  |
| 156 | + |
| 157 | +<!--2. In the **Configure and add module** blade, input the following values: |
| 158 | +
|
| 159 | + |Input share | Select an input share. The Edge local share is the input share in this case. The module used here moves files from the Edge local share to an Edge share where they are uploaded into the cloud. | |
| 160 | + |Output share | Select an output share. The Edge share is the output share in this case. | |
| 161 | +--> |
| 162 | + |
| 163 | +2. In your IoT Hub resource, go to **IoT Edge device** and then select your IoT Edge device. |
| 164 | + |
| 165 | +  |
| 166 | + |
| 167 | +3. On **Device details**, select **Set Modules**. |
| 168 | + |
| 169 | +  |
| 170 | + |
| 171 | +4. Under **Add Modules**, do the following: |
| 172 | + |
| 173 | + 1. Enter the name, address, user name, and password for the container registry settings for the custom module. |
| 174 | + The name, address, and listed credentials are used to retrieve modules with a matching URL. To deploy this module, under **Deployment modules**, select **IoT Edge module**. This IoT Edge module is a docker container that you can deploy to the IoT Edge device that's associated with your Data Box Edge device. |
| 175 | + |
| 176 | +  |
| 177 | + |
| 178 | + 2. Specify the settings for the IoT Edge custom module. Input the following values. |
| 179 | + |
| 180 | + |Field |Value | |
| 181 | + |---------|---------| |
| 182 | + |Name | A unique name for the module. This module is a docker container that you can deploy to the IoT Edge device associated with your Data Box Edge. | |
| 183 | + |Image URI | The image URI for the corresponding container image for the module. | |
| 184 | + |Credentials required | If checked, username and password are used to retrieve modules with a matching URL. | |
| 185 | + |
| 186 | + In the **Container Create Options** box, enter the local mount points for the Edge modules that you copied in the preceding steps for the Edge share and Edge local share. |
| 187 | + |
| 188 | + > [!IMPORTANT] |
| 189 | + > The paths used here are mounted into your container, so they must match what the functionality in your container expects. If you're following [Create a custom module](data-box-edge-create-iot-edge-module.md#update-the-module-with-custom-code), the code specified in that module expects the copied paths. Do not modify these paths. |
| 190 | + |
| 191 | + In the **Container Create Options** box, you can paste the following sample: |
| 192 | + |
| 193 | + ``` |
| 194 | + { |
| 195 | + "HostConfig": { |
| 196 | + "Binds": [ |
| 197 | + "/home/hcsshares/mydbesmbedgelocalshare1:/home/input", |
| 198 | + "/home/hcsshares/mydbesmbedgeshare1:/home/output" |
| 199 | + ] |
| 200 | + } |
| 201 | + } |
| 202 | + ``` |
| 203 | +
|
| 204 | + Provide any environmental variables used for your module. Environmental variables provide optional information that help define the environment in which your module runs. |
| 205 | +
|
| 206 | +  |
| 207 | + |
| 208 | + 4. If necessary, configure the advanced Edge runtime settings, and then click **Next**. |
| 209 | +
|
| 210 | +  |
| 211 | + |
| 212 | +5. Under **Specify Routes**, set routes between modules. |
| 213 | + |
| 214 | +  |
| 215 | +
|
| 216 | + You can replace *route* with the following route string that you copied earlier. In this example, enter the name of the local share that will push data to the cloud share. Replace the `modulename` with the name of the module. Select **Next**. |
| 217 | + |
| 218 | + ``` |
| 219 | + "route": "FROM /* WHERE topic = 'mydbesmbedgelocalshare1' INTO BrokeredEndpoint(\"/modules/filemove/inputs/input1\")" |
| 220 | + ``` |
| 221 | +
|
| 222 | +  |
| 223 | +
|
| 224 | +6. Under **Review deployment**, review all the settings, and then select **Submit** to submit the module for deployment. |
| 225 | +
|
| 226 | +  |
| 227 | + |
| 228 | + This action starts the module deployment. After the deployment is complete, the **Runtime status** of module is **running**. |
| 229 | +
|
| 230 | +  |
| 231 | +
|
| 232 | +## Verify data transform, transfer |
| 233 | +
|
| 234 | +The final step is to ensure that the module is connected and running as expected. The run-time status of the module should be running for your IoT Edge device in the IoT Hub resource. |
| 235 | +
|
| 236 | +Take the following steps to verify data transform and transfer to Azure. |
| 237 | + |
| 238 | +1. In File Explorer, connect to both the Edge local and Edge shares you created previously. |
| 239 | +
|
| 240 | +  |
| 241 | + |
| 242 | +1. Add data to the local share. |
| 243 | +
|
| 244 | +  |
| 245 | + |
| 246 | + The data gets moved to the cloud share. |
| 247 | +
|
| 248 | +  |
| 249 | +
|
| 250 | + The data is then pushed from the cloud share to the storage account. To view the data, go to your storage account and then select **Storage Explorer**. You can view the uploaded data in your storage account. |
| 251 | +
|
| 252 | +  |
| 253 | + |
| 254 | +You have completed the validation process. |
| 255 | +
|
| 256 | +## Next steps |
| 257 | +
|
| 258 | +In this tutorial, you learned how to: |
| 259 | +
|
| 260 | +> [!div class="checklist"] |
| 261 | +> * Configure compute |
| 262 | +> * Add shares |
| 263 | +> * Add a trigger |
| 264 | +> * Add a compute module |
| 265 | +> * Verify data transform and transfer |
| 266 | +
|
| 267 | +To learn how to administer your Data Box Edge device, see: |
| 268 | +
|
| 269 | +> [!div class="nextstepaction"] |
| 270 | +> [Use local web UI to administer a Data Box Edge](data-box-edge-manage-access-power-connectivity-mode.md) |
0 commit comments