Terraform - authenticating using azure CLI when behind proxy

I am trying to use terraform with azure behind a corporate proxy. I am trying to authenticate using Azure CLI as described here.

I set the environmental variables HTTP_PROXY and HTTPS_PROXY appropriately. I also had to disable certificate verification using the variable AZURE_CLI_DISABLE_CONNECTION_VERIFICATION.

After this “az login” and azure cli commands started working. Terraform init also works

But terraform plan fails with the following error.

Error: Error building account: Error getting authenticated object ID: Error parsing json result from the Azure CLI: Error retrieving running Azure CLI: WARNING: Connection verification disabled by environment variable AZURE_CLI_DISABLE_CONNECTION_VERIFICATION
C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\urllib3\connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\urllib3\connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warn

Any help would be appreciated!