Can't apply terraform through OctopusDeploy with AzureRM backend through proxy

I am trying to use the OctopusDeploy terraform apply step to generate my infrastructure using an AzureRM backend. The backend is set up and works from my computer.

When I try it from OctoopusDeploy it doesn’t seem to be able to get through the Proxy - which is an authenticating proxy.

I’ve got the proxy set up in OctopusDeploy (and the packages are fed from a NuGet feed which comes through the proxy) and I have HTTP_PROXY and HTTPS_PROXY set in the system environment variables. The Octopus service is running as a user that has permissions to use the internet through the proxy

Here’s the output:

Info    Extracting package: C:\Octopus\OctopusServer\PackageCache\feeds-app-hub\TF_AppHub@S1.1.35248@7308A1964B1A0D48AF04BB90C9FBB55D.nupkg 
Info    terraform.exe init -no-color -input=false -get-plugins=true -backend-config= access_key=<acc_key>
Info    Initializing the backend... 
Info    Successfully configured the backend "azurerm"! Terraform will automatically use this backend unless the backend configuration changes. 
Error    Error refreshing state: Get https://<storage_acc> proxyconnect tcp: EOF 
Fatal    The remote script failed with exit code 1 
Fatal    The action Create Infrastructure on the Octopus Server failed 


Thanks for getting in touch.

There was an issue fixed recently here where proxy support in Terraform was not working. This has been fixed in version 2018.8.7.

Are you in a position where you can upgrade and verify if that fixes the problem you are seeing?

Hope this helps.