Skip to content

Commit 0be1553

Browse files
authored
Merge pull request #102305 from kgremban/jan24-bulkformatting
Bulk formatting and acrolinx updates
2 parents c1d8160 + 54102d4 commit 0be1553

9 files changed

+383
-385
lines changed

articles/iot-edge/tutorial-deploy-function.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,34 @@ You can use Azure Functions to deploy code that implements your business logic d
2525
2626
<center>
2727

28-
![Diagram - Tutorial architecture, stage and deploy function module](./media/tutorial-deploy-function/functions-architecture.png)
28+
![Diagram - Tutorial architecture: stage and deploy function module](./media/tutorial-deploy-function/functions-architecture.png)
2929
</center>
3030

3131
>[!NOTE]
32-
>Azure Function modules on Azure IoT Edge are in [public preview](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
32+
>Azure Function modules on Azure IoT Edge are in [public preview](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
3333
34-
The Azure function that you create in this tutorial filters the temperature data that's generated by your device. The function only sends messages upstream to Azure IoT Hub when the temperature is above a specified threshold.
34+
The Azure function that you create in this tutorial filters the temperature data that's generated by your device. The function only sends messages upstream to Azure IoT Hub when the temperature is above a specified threshold.
3535

3636
[!INCLUDE [quickstarts-free-trial-note](../../includes/quickstarts-free-trial-note.md)]
3737

3838
## Prerequisites
3939

40-
Before beginning this tutorial, you should have gone through the previous tutorial to set up your development environment for Linux container development: [Develop IoT Edge modules for Linux devices](tutorial-develop-for-linux.md). By completing that tutorial, you should have the following prerequisites in place:
40+
Before beginning this tutorial, you should have gone through the previous tutorial to set up your development environment for Linux container development: [Develop IoT Edge modules for Linux devices](tutorial-develop-for-linux.md). By completing that tutorial, you should have the following prerequisites in place:
4141

4242
* A free or standard-tier [IoT Hub](../iot-hub/iot-hub-create-through-portal.md) in Azure.
4343
* A [Linux device running Azure IoT Edge](quickstart-linux.md)
4444
* A container registry, like [Azure Container Registry](https://docs.microsoft.com/azure/container-registry/).
4545
* [Visual Studio Code](https://code.visualstudio.com/) configured with the [Azure IoT Tools](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-tools).
4646
* [Docker CE](https://docs.docker.com/install/) configured to run Linux containers.
4747

48-
To develop an IoT Edge module in with Azure Functions, install the following additional prerequisites on your development machine:
48+
To develop an IoT Edge module in with Azure Functions, install the following additional prerequisites on your development machine:
4949

5050
* [C# for Visual Studio Code (powered by OmniSharp) extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp).
5151
* [The .NET Core 2.1 SDK](https://www.microsoft.com/net/download).
5252

5353
## Create a function project
5454

55-
The Azure IoT Tools for Visual Studio Code that you installed in the prerequisites provides management capabilities as well as some code templates. In this section, you use Visual Studio Code to create an IoT Edge solution that contains an Azure function.
55+
The Azure IoT Tools for Visual Studio Code that you installed in the prerequisites provides management capabilities as well as some code templates. In this section, you use Visual Studio Code to create an IoT Edge solution that contains an Azure function.
5656

5757
### Create a new project
5858

@@ -84,11 +84,11 @@ The environment file stores the credentials for your container registry and shar
8484

8585
### Select your target architecture
8686

87-
Currently, Visual Studio Code can develop C modules for Linux AMD64 and Linux ARM32v7 devices. You need to select which architecture you're targeting with each solution, because the container is built and run differently for each architecture type. The default is Linux AMD64.
87+
Currently, Visual Studio Code can develop C modules for Linux AMD64 and Linux ARM32v7 devices. You need to select which architecture you're targeting with each solution, because the container is built and run differently for each architecture type. The default is Linux AMD64.
8888

89-
1. Open the command palette and search for **Azure IoT Edge: Set Default Target Platform for Edge Solution**, or select the shortcut icon in the side bar at the bottom of the window.
89+
1. Open the command palette and search for **Azure IoT Edge: Set Default Target Platform for Edge Solution**, or select the shortcut icon in the side bar at the bottom of the window.
9090

91-
2. In the command palette, select the target architecture from the list of options. For this tutorial, we're using an Ubuntu virtual machine as the IoT Edge device, so will keep the default **amd64**.
91+
2. In the command palette, select the target architecture from the list of options. For this tutorial, we're using an Ubuntu virtual machine as the IoT Edge device, so will keep the default **amd64**.
9292

9393
### Update the module with custom code
9494

@@ -141,7 +141,7 @@ Let's add some additional code so that the module processes the messages at the
141141
{filteredMessage.Properties.Add(prop.Key, prop.Value);}
142142
// Add a new property to the message to indicate it is an alert.
143143
filteredMessage.Properties.Add("MessageType", "Alert");
144-
// Send the message.
144+
// Send the message.
145145
await output.AddAsync(filteredMessage);
146146
logger.LogInformation("Info: Received and transferred a message with temperature above the threshold");
147147
}
@@ -173,11 +173,11 @@ Let's add some additional code so that the module processes the messages at the
173173

174174
## Build your IoT Edge solution
175175

176-
In the previous section, you created an IoT Edge solution and added code to the **CSharpFunction** to filter out messages where the reported machine temperature is less than the acceptable threshold. Now you need to build the solution as a container image and push it to your container registry.
176+
In the previous section, you created an IoT Edge solution and modified the **CSharpFunction** to filter out messages with reported machine temperatures below the acceptable threshold. Now you need to build the solution as a container image and push it to your container registry.
177177

178178
In this section, you provide the credentials for your container registry for the second time (the first was in the **.env** file of your IoT Edge solution) by signing in locally from your development machine so that Visual Studio Code can push images to your registry.
179179

180-
1. Open the VS Code integrated terminal by selecting **View** > **Terminal**.
180+
1. Open the VS Code integrated terminal by selecting **View** > **Terminal**.
181181

182182
2. Sign in to your container registry by entering the following command in the integrated terminal. Use the username and login server that you copied from your Azure container registry earlier.
183183

@@ -192,52 +192,52 @@ In this section, you provide the credentials for your container registry for the
192192
Login Succeeded
193193
```
194194
195-
3. In the VS Code explorer, right-click the deployment.template.json file and select **Build and Push IoT Edge solution**.
195+
3. In the VS Code explorer, right-click the deployment.template.json file and select **Build and Push IoT Edge solution**.
196196
197-
When you tell Visual Studio Code to build your solution, it first takes the information in the deployment template and generates a deployment.json file in a new folder named **config**. Then it runs two commands in the integrated terminal: `docker build` and `docker push`. These two commands build your code, containerize the functions, and then push the code to the container registry that you specified when you initialized the solution.
197+
When you tell Visual Studio Code to build your solution, it first takes the information in the deployment template and generates a deployment.json file in a new folder named **config**. Then it runs two commands in the integrated terminal: `docker build` and `docker push`. The build command builds your code and containerizes the functions. Then, the push command pushes the code to the container registry that you specified when you initialized the solution.
198198
199199
## View your container image
200200
201-
Visual Studio Code outputs a success message when your container image is pushed to your container registry. If you want to confirm the successful operation for yourself, you can view the image in the registry.
201+
Visual Studio Code outputs a success message when your container image is pushed to your container registry. If you want to confirm the successful operation for yourself, you can view the image in the registry.
202202
203-
1. In the Azure portal, browse to your Azure container registry.
203+
1. In the Azure portal, browse to your Azure container registry.
204204
2. Select **Repositories**.
205205
3. You should see the **csharpfunction** repository in the list. Select this repository to see more details.
206-
4. In the **Tags** section, you should see the **0.0.1-amd64** tag. This tag indicates the version and platform of the image that you built. These values are set in the module.json file in the CSharpFunction folder.
206+
4. In the **Tags** section, you should see the **0.0.1-amd64** tag. This tag indicates the version and platform of the image that you built. These values are set in the module.json file in the CSharpFunction folder.
207207
208208
## Deploy and run the solution
209209
210-
You can use the Azure portal to deploy your function module to an IoT Edge device like you did in the quickstarts. You can also deploy and monitor modules from within Visual Studio Code. The following sections use the Azure IoT Tools for VS Code that was listed in the prerequisites. Install the extension now, if you didn't already.
210+
You can use the Azure portal to deploy your function module to an IoT Edge device like you did in the quickstarts. You can also deploy and monitor modules from within Visual Studio Code. The following sections use the Azure IoT Tools for VS Code that was listed in the prerequisites. Install the extension now, if you didn't already.
211211
212-
1. In the VS Code explorer, expand the **Azure IoT Hub Devices** section.
212+
1. In the VS Code explorer, expand the **Azure IoT Hub Devices** section.
213213
214-
2. Right-click the name of your IoT Edge device, and then select **Create Deployment for single device**.
214+
2. Right-click the name of your IoT Edge device, and then select **Create Deployment for single device**.
215215
216216
3. Browse to the solution folder that contains the **CSharpFunction**. Open the config folder, select the **deployment.json** file, and then choose **Select Edge Deployment Manifest**.
217217
218-
4. Refresh the **Azure IoT Hub Devices** section. You should see the new **CSharpFunction** running along with the **SimulatedTemperatureSensor** module and the **$edgeAgent** and **$edgeHub**. It may take a few moments for the new modules to show up. Your IoT Edge device has to retrieve its new deployment information from IoT Hub, start the new containers, and then report the status back to IoT Hub.
218+
4. Refresh the **Azure IoT Hub Devices** section. You should see the new **CSharpFunction** running along with the **SimulatedTemperatureSensor** module and the **$edgeAgent** and **$edgeHub**. It may take a few moments for the new modules to show up. Your IoT Edge device has to retrieve its new deployment information from IoT Hub, start the new containers, and then report the status back to IoT Hub.
219219
220220
![View deployed modules in VS Code](./media/tutorial-deploy-function/view-modules.png)
221221
222-
## View generated data
222+
## View the generated data
223223
224224
You can see all of the messages that arrive at your IoT hub by running **Azure IoT Hub: Start Monitoring Built-in Event Endpoint** in the command palette.
225225
226226
You can also filter the view to see all of the messages that arrive at your IoT hub from a specific device. Right-click the device in the **Azure IoT Hub Devices** section and select **Start Monitoring Built-in Event Endpoint**.
227227
228-
To stop monitoring messages, run the command **Azure IoT Hub: Stop Monitoring Built-in Event Endpoint** in the command palette.
228+
To stop monitoring messages, run the command **Azure IoT Hub: Stop Monitoring Built-in Event Endpoint** in the command palette.
229229
230230
## Clean up resources
231231
232-
If you plan to continue to the next recommended article, you can keep the resources and configurations that you created and reuse them. You can also keep using the same IoT Edge device as a test device.
232+
If you plan to continue to the next recommended article, you can keep the resources and configurations that you created and reuse them. You can also keep using the same IoT Edge device as a test device.
233233
234-
Otherwise, you can delete the local configurations and the Azure resources that you created in this article to avoid charges.
234+
Otherwise, you can delete the local configurations and the Azure resources that you created in this article to avoid charges.
235235
236236
[!INCLUDE [iot-edge-clean-up-cloud-resources](../../includes/iot-edge-clean-up-cloud-resources.md)]
237237
238238
## Next steps
239239
240-
In this tutorial, you created an Azure function module with code to filter raw data that's generated by your IoT Edge device. When you're ready to build your own modules, you can learn more about how to [Develop with Azure IoT Edge for Visual Studio Code](how-to-vs-code-develop-module.md).
240+
In this tutorial, you created an Azure function module with code to filter raw data that's generated by your IoT Edge device. When you're ready to build your own modules, you can learn more about how to [Develop with Azure IoT Edge for Visual Studio Code](how-to-vs-code-develop-module.md).
241241
242242
Continue on to the next tutorials to learn other ways that Azure IoT Edge can help you turn data into business insights at the edge.
243243

0 commit comments

Comments
 (0)