databricks-cli icon indicating copy to clipboard operation
databricks-cli copied to clipboard

Pass proxy manually

Open kasuteru opened this issue 4 years ago • 0 comments

I am using the Databricks CLI programmatically, behind a corporate proxy. Since the CLI is based upon the requests module, I am guessing (not sure?) that I can set a proxy via environment variables http_proxy and https_proxy.

However, in my code, I need to access multiple different proxies with different calls. Is there an option to tell the CLI connection directly which proxy to use? I guess this would have to be passed to the underlying sessions object, however, it looks like there is currently no option for that?

If there indeed isn't, I would propose creating one. The best place, as far as I can see, would be in the __init__ function of the API client:

https://github.com/databricks/databricks-cli/blob/6c429d4f581fc99f54cbf9239879434310037cc7/databricks_cli/sdk/api_client.py#L65-L89

Any input on this is welcome.

kasuteru avatar Dec 14 '21 15:12 kasuteru