Azure / Azure/azure-cli

az container exec does not work behind http proxy

Open
#17,103 4 comments 0 reactions 0 assignees View on GitHub
act-observability-squad Container Instances Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Describe the bug**

`az container exec` does not work behind my corporate HTTP proxy. The command uses the `websocket` module, and it does not honor the `http_proxy` or `https_proxy` environment variables on my RHEL OS. The command eventually times out with `TimeoutError: [Errno 110] Connection timed out`.

**To Reproduce**
Be on a network where outbound traffic is only allowed via HTTP proxy, and type
`http_proxy=somehttpproxy.com:80 https_proxy=somehttpproxy.com:80 az container exec --exec-command /bin/sh --name mycontainergroup --container-name mycontainername --resource-group myresourcegroup`

**Expected behavior**
az cli should honor `http_proxy` and `https_proxy` when connecting with `websocket` to start the exec pipe to the container group, and the command should execute successfully.

## Environment Summary
```
Linux-3.10.0-1160.6.1.el7.x86_64-x86_64-with-redhat-7.9-Maipo
Python 3.6.8
Installer: RPM

azure-cli 2.19.1

```

**Additional context**
[This PR](https://github.com/magnus-longva-bouvet/azure-cli/pull/1/files) is an example of a monkey patch which solves the issue for me.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.