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
IoT Edge devices send HTTPS requests to communicate with IoT Hub. If your device is connected to a network that uses a proxy server, you need to configure the IoT Edge runtime to communicate through the server. Proxy servers can also affect individual IoT Edge modules if they make HTTP or HTTPS requests that aren't routed through the IoT Edge hub.
17
+
IoT Edge devices send HTTPS requests to communicate with IoT Hub. If you connected your device to a network that uses a proxy server, you need to configure the IoT Edge runtime to communicate through the server. Proxy servers can also affect individual IoT Edge modules if they make HTTP or HTTPS requests that you haven't routed through the IoT Edge hub.
18
18
19
19
This article walks through the following four steps to configure and then manage an IoT Edge device behind a proxy server:
20
20
21
21
1.[**Install the IoT Edge runtime on your device**](#install-iot-edge-through-a-proxy)
22
22
23
23
The IoT Edge installation scripts pull packages and files from the internet, so your device needs to communicate through the proxy server to make those requests. For Windows devices, the installation script also provides an offline installation option.
24
24
25
-
This step is a one-time process to configure the IoT Edge device when you first set it up. The same connections are also required when you update the IoT Edge runtime.
25
+
This step is a one-time process to configure the IoT Edge device when you first set it up. You also need these same connections when you update the IoT Edge runtime.
26
26
27
27
2.[**Configure IoT Edge and the container runtime on your device**](#configure-iot-edge-and-moby)
28
28
@@ -32,13 +32,13 @@ This article walks through the following four steps to configure and then manage
32
32
33
33
3.[**Configure the IoT Edge agent properties in the config file on your device**](#configure-the-iot-edge-agent)
34
34
35
-
The IoT Edge daemon starts the edgeAgent module initially. Then, the edgeAgent module retrieves the deployment manifest from IoT Hub and starts all the other modules. For the IoT Edge agent to make the initial connection to IoT Hub, configure the edgeAgent module environment variables manually on the device itself. After the initial connection, you can configure the edgeAgent module remotely.
35
+
The IoT Edge daemon starts the edgeAgent module initially. Then, the edgeAgent module retrieves the deployment manifest from IoT Hub and starts all the other modules. Configure the edgeAgent module environment variables manually on the device itself, so that the IoT Edge agent can make the initial connection to IoT Hub. After the initial connection, you can configure the edgeAgent module remotely.
36
36
37
37
This step is a one-time process to configure the IoT Edge device when you first set it up.
38
38
39
39
4.[**For all future module deployments, set environment variables for any module communicating through the proxy**](#configure-deployment-manifests)
40
40
41
-
Once your IoT Edge device is set up and connected to IoT Hub through the proxy server, you need to maintain the connection in all future module deployments.
41
+
Once you set up and connect an IoT Edge device to IoT Hub through the proxy server, you need to maintain the connection in all future module deployments.
42
42
43
43
This step is an ongoing process done remotely so that every new module or deployment update maintains the device's ability to communicate through the proxy server.
44
44
@@ -60,11 +60,11 @@ Whether your IoT Edge device runs on Windows or Linux, you need to access the in
60
60
61
61
### Linux devices
62
62
63
-
If you're installing the IoT Edge runtime on a Linux device, configure the package manager to go through your proxy server to access the installation package. For example, [Set up apt-get to use a http-proxy](https://help.ubuntu.com/community/AptGet/Howto/#Setting_up_apt-get_to_use_a_http-proxy). Once your package manager is configured, follow the instructions in [Install Azure IoT Edge runtime](how-to-provision-single-device-linux-symmetric.md) as usual.
63
+
If you're installing the IoT Edge runtime on a Linux device, configure the package manager to go through your proxy server to access the installation package. For example, [Set up apt-get to use a http-proxy](https://help.ubuntu.com/community/AptGet/Howto/#Setting_up_apt-get_to_use_a_http-proxy). Once you configure your package manager, follow the instructions in [Install Azure IoT Edge runtime](how-to-provision-single-device-linux-symmetric.md) as usual.
64
64
65
65
### Windows devices using IoT Edge for Linux on Windows
66
66
67
-
If you're installing the IoT Edge runtime using IoT Edge for Linux on Windows, IoT Edge is installed by default on your Linux virtual machine. No additional installation or update steps are required.
67
+
If you're installing the IoT Edge runtime using IoT Edge for Linux on Windows, IoT Edge is installed by default on your Linux virtual machine. You're not required to install or update any other steps.
68
68
69
69
### Windows devices using Windows containers
70
70
@@ -84,7 +84,7 @@ The following steps demonstrate an example of a windows installation using the `
If you have complicated credentials for the proxy server that can't be included in the URL, use the `-ProxyCredential` parameter within `-InvokeWebRequestParameters`. For example,
87
+
If you have complicated credentials for the proxy server that you can't include in the URL, use the `-ProxyCredential` parameter within `-InvokeWebRequestParameters`. For example,
@@ -98,7 +98,7 @@ For more information about proxy parameters, see [Invoke-WebRequest](/powershell
98
98
99
99
IoT Edge relies on two daemons running on the IoT Edge device. The Moby daemon makes web requests to pull container images from container registries. The IoT Edge daemon makes web requests to communicate with IoT Hub.
100
100
101
-
Both the Moby and the IoT Edge daemons need to be configured to use the proxy server for ongoing device functionality. This step takes place on the IoT Edge device during initial device setup.
101
+
You must configure both the Moby and the IoT Edge daemons to use the proxy server for ongoing device functionality. This step takes place on the IoT Edge device during initial device setup.
102
102
103
103
### Moby daemon
104
104
@@ -113,13 +113,12 @@ Choose the article that applies to your IoT Edge device operating system:
113
113
114
114
### IoT Edge daemon
115
115
116
-
The IoT Edge daemon is configured in a similar manner to the Moby daemon. Use the following steps to set an environment variable for the service, based on your operating system.
116
+
The IoT Edge daemon is similar to the Moby daemon. Use the following steps to set an environment variable for the service, based on your operating system.
117
117
118
118
The IoT Edge daemon always uses HTTPS to send requests to IoT Hub.
119
119
120
120
#### Linux
121
121
122
-
123
122
Open an editor in the terminal to configure the IoT Edge daemon.
124
123
125
124
```bash
@@ -158,7 +157,7 @@ Restart the IoT Edge system services for the changes to both daemons to take eff
158
157
sudo iotedge system restart
159
158
```
160
159
161
-
Verify that your environment variables were created, and the new configuration was loaded.
160
+
Verify that your environment variables and the new configuration are present.
162
161
163
162
```bash
164
163
systemctl show --property=Environment aziot-edged
@@ -167,13 +166,13 @@ systemctl show --property=Environment aziot-identityd
167
166
168
167
#### Windows using IoT Edge for Linux on Windows
169
168
170
-
Log in to your IoT Edge for Linux on Windows virtual machine:
169
+
Sign in to your IoT Edge for Linux on Windows virtual machine:
171
170
172
171
```powershell
173
172
Connect-EflowVm
174
173
```
175
174
176
-
Follow the same steps as the Linux section above to configure the IoT Edge daemon.
175
+
Follow the same steps as the Linux section of this article to configure the IoT Edge daemon.
177
176
178
177
#### Windows using Windows containers
179
178
@@ -191,13 +190,13 @@ Restart-Service iotedge
191
190
192
191
## Configure the IoT Edge agent
193
192
194
-
The IoT Edge agent is the first module to start on any IoT Edge device. It's started for the first time based on the information in the IoT Edge config file. The IoT Edge agent then connects to IoT Hub to retrieve deployment manifests, which declare what other modules should be deployed on the device.
193
+
The IoT Edge agent is the first module to start on any IoT Edge device. This module starts for the first time based on information in the IoT Edge config file. The IoT Edge agent then connects to IoT Hub to retrieve deployment manifests. The manifest declares which other modules the device should deploy.
195
194
196
195
This step takes place once on the IoT Edge device during initial device setup.
197
196
198
-
1. Open the config file on your IoT Edge device: `/etc/aziot/config.toml`. The configuration file is protected, so you need administrative privileges to access it. On Linux systems, use the `sudo` command before opening the file in your preferred text editor.
197
+
1. Open the config file on your IoT Edge device: `/etc/aziot/config.toml`. You need administrative privileges to access the configuration file. On Linux systems, use the `sudo` command before opening the file in your preferred text editor.
199
198
200
-
2. In the config file, find the `[agent]` section, which contains all the configuration information for the edgeAgent module to use on startup. Check and make sure that the `[agent]`section is uncommented or add it if it is not included in the `config.toml`. The IoT Edge agent definition includes an `[agent.env]` subsection where you can add environment variables.
199
+
2. In the config file, find the `[agent]` section, which contains all the configuration information for the edgeAgent module to use on startup. Check to make sure the `[agent]`section is without comments. If the `[agent]` section is missing, add it to the `config.toml`. The IoT Edge agent definition includes an `[agent.env]` subsection where you can add environment variables.
201
200
202
201
3. Add the **https_proxy** parameter to the environment variables section, and set your proxy URL as its value.
203
202
@@ -261,17 +260,17 @@ This step takes place once on the IoT Edge device during initial device setup.
261
260
sudo iotedge config apply
262
261
```
263
262
264
-
6. Verify that your proxy settings are propagated using `docker inspect edgeAgent` in the `Env` section. If not, the container must be recreated.
263
+
6. Verify that your proxy settings are propagated using `docker inspect edgeAgent` in the `Env` section. If not, you must recreate the container.
265
264
266
265
```bash
267
266
sudo docker rm -f edgeAgent
268
267
```
269
268
270
-
7. The IoT Edge runtime should recreate `edgeAgent` within a minute. Once `edgeAgent` container is running again, `docker inspect edgeAgent`and verify the proxy settings matches the configuration file.
269
+
7. The IoT Edge runtime should recreate `edgeAgent` within a minute. Once the `edgeAgent` container is running again, use the `docker inspect edgeAgent`command to verify that the proxy settings match the configuration file.
271
270
272
271
## Configure deployment manifests
273
272
274
-
Once your IoT Edge device is configured to work with your proxy server, you need to continue to declare the HTTPS_PROXY environment variable in future deployment manifests. You can edit deployment manifests either using the Azure portal wizard or by editing a deployment manifest JSON file.
273
+
Once you configure your IoT Edge device to work with your proxy server, declare the HTTPS_PROXY environment variable in future deployment manifests. You can edit deployment manifests either using the Azure portal wizard or by editing a deployment manifest JSON file.
275
274
276
275
Always configure the two runtime modules, edgeAgent and edgeHub, to communicate through the proxy server so they can maintain a connection with IoT Hub. If you remove the proxy information from the edgeAgent module, the only way to reestablish connection is by editing the config file on the device, as described in the previous section.
277
276
@@ -291,11 +290,11 @@ Add the **https_proxy** environment variable to both the IoT Edge agent and IoT
All other modules that you add to a deployment manifest follow the same pattern.
293
+
All other modules that you add to a deployment manifest follow the same pattern. Select **Apply** to save your changes.
295
294
296
295
### JSON deployment manifest files
297
296
298
-
If you create deployments for IoT Edge devices using the templates in Visual Studio Code or by manually creating JSON files, you can add the environment variables directly to each module definition.
297
+
If you create deployments for IoT Edge devices using the templates in Visual Studio Code or by manually creating JSON files, you can add the environment variables directly to each module definition. If you didn't add them in the Azure portal, add them here to your JSON manifest file. Replace `<proxy URL>` with your own value.
299
298
300
299
Use the following JSON format:
301
300
@@ -313,7 +312,7 @@ With the environment variables included, your module definition should look like
@@ -341,9 +340,9 @@ If you included the **UpstreamProtocol** environment variable in the confige.yam
341
340
342
341
## Working with traffic-inspecting proxies
343
342
344
-
Some proxies like [Zscaler](https://www.zscaler.com) can inspect TLS-encrypted traffic. During TLS traffic inspection, the certificate returned by the proxy isn't the certificate from the target server, but instead is the certificate signed by the proxy's own root certificate. By default, this proxy's certificate isn't trusted by IoT Edge modules (including *edgeAgent* and *edgeHub*), and the TLS handshake fails.
343
+
Some proxies like [Zscaler](https://www.zscaler.com) can inspect TLS-encrypted traffic. During TLS traffic inspection, the certificate returned by the proxy isn't the certificate from the target server, but instead is the certificate signed by the proxy's own root certificate. By default, IoT Edge modules (including *edgeAgent* and *edgeHub*) don't trust this proxy's certificate and the TLS handshake fails.
345
344
346
-
To resolve this, the proxy's root certificate needs to be trusted by both the operating system and IoT Edge modules.
345
+
To resolve the failed handshake, configure both the operating system and IoT Edge modules to trust the proxy's root certificate with the following steps.
347
346
348
347
1. Configure proxy certificate in the trusted root certificate store of your host operating system. For more information about how to install a root certificate, see [Install root CA to OS certificate store](how-to-manage-device-certificates.md#install-root-ca-to-os-certificate-store).
349
348
@@ -353,7 +352,7 @@ To configure traffic inspection proxy support for containers not managed by IoT
353
352
354
353
## Fully qualified domain names (FQDNs) of destinations that IoT Edge communicates with
355
354
356
-
If your proxy has a firewall that requires you to allowlist all FQDNs for internet connectivity, review the list from [Allow connections from IoT Edge devices](production-checklist.md#allow-connections-from-iot-edge-devices) to determine which FQDNs to add.
355
+
If your proxy's firewall requires you to add all FQDNs to your allowlist for internet connectivity, review the list from [Allow connections from IoT Edge devices](production-checklist.md#allow-connections-from-iot-edge-devices) to determine which FQDNs to add.
0 commit comments