Skip to content

Commit 490f201

Browse files
Merge pull request #227700 from w-azure/winona-proxy
Updates based on support team feedback
2 parents a711285 + 31d1216 commit 490f201

File tree

2 files changed

+24
-25
lines changed

2 files changed

+24
-25
lines changed

articles/iot-edge/how-to-configure-proxy-support.md

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ ms.custom: [amqp, contperf-fy21q1]
1414

1515
[!INCLUDE [iot-edge-version-1.4](includes/iot-edge-version-1.4.md)]
1616

17-
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.
1818

1919
This article walks through the following four steps to configure and then manage an IoT Edge device behind a proxy server:
2020

2121
1. [**Install the IoT Edge runtime on your device**](#install-iot-edge-through-a-proxy)
2222

2323
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.
2424

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.
2626

2727
2. [**Configure IoT Edge and the container runtime on your device**](#configure-iot-edge-and-moby)
2828

@@ -32,13 +32,13 @@ This article walks through the following four steps to configure and then manage
3232

3333
3. [**Configure the IoT Edge agent properties in the config file on your device**](#configure-the-iot-edge-agent)
3434

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.
3636

3737
This step is a one-time process to configure the IoT Edge device when you first set it up.
3838

3939
4. [**For all future module deployments, set environment variables for any module communicating through the proxy**](#configure-deployment-manifests)
4040

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.
4242

4343
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.
4444

@@ -60,11 +60,11 @@ Whether your IoT Edge device runs on Windows or Linux, you need to access the in
6060

6161
### Linux devices
6262

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.
6464

6565
### Windows devices using IoT Edge for Linux on Windows
6666

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.
6868

6969
### Windows devices using Windows containers
7070

@@ -84,7 +84,7 @@ The following steps demonstrate an example of a windows installation using the `
8484
. {Invoke-WebRequest -proxy <proxy URL> -useb aka.ms/iotedge-win} | Invoke-Expression; Initialize-IoTEdge
8585
```
8686

87-
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,
8888

8989
```powershell
9090
$proxyCredential = (Get-Credential).GetNetworkCredential()
@@ -98,7 +98,7 @@ For more information about proxy parameters, see [Invoke-WebRequest](/powershell
9898

9999
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.
100100

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.
102102

103103
### Moby daemon
104104

@@ -113,13 +113,12 @@ Choose the article that applies to your IoT Edge device operating system:
113113

114114
### IoT Edge daemon
115115

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.
117117

118118
The IoT Edge daemon always uses HTTPS to send requests to IoT Hub.
119119

120120
#### Linux
121121

122-
123122
Open an editor in the terminal to configure the IoT Edge daemon.
124123

125124
```bash
@@ -158,7 +157,7 @@ Restart the IoT Edge system services for the changes to both daemons to take eff
158157
sudo iotedge system restart
159158
```
160159

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.
162161

163162
```bash
164163
systemctl show --property=Environment aziot-edged
@@ -167,13 +166,13 @@ systemctl show --property=Environment aziot-identityd
167166

168167
#### Windows using IoT Edge for Linux on Windows
169168

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:
171170

172171
```powershell
173172
Connect-EflowVm
174173
```
175174

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.
177176

178177
#### Windows using Windows containers
179178

@@ -191,13 +190,13 @@ Restart-Service iotedge
191190

192191
## Configure the IoT Edge agent
193192

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.
195194

196195
This step takes place once on the IoT Edge device during initial device setup.
197196

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.
199198

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.
201200

202201
3. Add the **https_proxy** parameter to the environment variables section, and set your proxy URL as its value.
203202

@@ -261,17 +260,17 @@ This step takes place once on the IoT Edge device during initial device setup.
261260
sudo iotedge config apply
262261
```
263262

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.
265264

266265
```bash
267266
sudo docker rm -f edgeAgent
268267
```
269268

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.
271270

272271
## Configure deployment manifests
273272

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.
275274

276275
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.
277276

@@ -291,11 +290,11 @@ Add the **https_proxy** environment variable to both the IoT Edge agent and IoT
291290

292291
![Set https_proxy environment variable](./media/how-to-configure-proxy-support/edgehub-environmentvar.png)
293292

294-
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.
295294

296295
### JSON deployment manifest files
297296

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.
299298

300299
Use the following JSON format:
301300

@@ -313,7 +312,7 @@ With the environment variables included, your module definition should look like
313312
"edgeHub": {
314313
"type": "docker",
315314
"settings": {
316-
"image": "mcr.microsoft.com/azureiotedge-hub:1.1",
315+
"image": "mcr.microsoft.com/azureiotedge-hub:1.4",
317316
"createOptions": "{}"
318317
},
319318
"env": {
@@ -341,9 +340,9 @@ If you included the **UpstreamProtocol** environment variable in the confige.yam
341340

342341
## Working with traffic-inspecting proxies
343342

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.
345344

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.
347346

348347
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).
349348

@@ -353,7 +352,7 @@ To configure traffic inspection proxy support for containers not managed by IoT
353352

354353
## Fully qualified domain names (FQDNs) of destinations that IoT Edge communicates with
355354

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.
357356

358357
## Next steps
359358

50.3 KB
Loading

0 commit comments

Comments
 (0)