<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Passing proxy configurations with databricks-sql-connector python? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/passing-proxy-configurations-with-databricks-sql-connector/m-p/33432#M24429</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to connect to databricks workspace which has IP Access restriction enabled using databricks-sql-connector. Only my Proxy server IPs are added in the allow list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;from databricks import sql
&amp;nbsp;
connection = sql.connect(
  server_hostname ='adb-random12094383.azuredatabricks.net', 
  http_path       ='/sql/1.0/endpoints/randomid', 
  access_token='&amp;lt;access token here&amp;gt;',
)
with connection.cursor() as cur:
  cur.execute('show schemas')
  print(cur.fetchall())&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This fails with the below error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;---------------------------------------------------------------------------
RequestError                              Traceback (most recent call last)
Input In [2], in &amp;lt;cell line: 1&amp;gt;()
----&amp;gt; 1 connection = sql.connect(
      2   server_hostname ='adb-2961643968016177.17.azuredatabricks.net', 
      3   http_path       ='/sql/1.0/endpoints/17a021e95a9e6f25', 
      4   access_token='dapi3d97e76ce3de34fb4ea060cf6b068e0a',
      5   http_headers= [("https_proxy", "http://proxy-dmz.intel.com:912"), ("http_proxy", "http://proxy-dmz.intel.com:912")]
      6   )
&amp;nbsp;
File ~/project/python/venv/lib/python3.8/site-packages/databricks/sql/__init__.py:50, in connect(server_hostname, http_path, access_token, **kwargs)
     47 def connect(server_hostname, http_path, access_token, **kwargs):
     48     from .client import Connection
---&amp;gt; 50     return Connection(server_hostname, http_path, access_token, **kwargs)
&amp;nbsp;
File ~/project/python/venv/lib/python3.8/site-packages/databricks/sql/client.py:129, in Connection.__init__(self, server_hostname, http_path, access_token, http_headers, session_configuration, catalog, schema, **kwargs)
    120 base_headers = [("User-Agent", useragent_header)] + authorization_header
    121 self.thrift_backend = ThriftBackend(
    122     self.host,
    123     self.port,
   (...)
    126     **kwargs
    127 )
--&amp;gt; 129 self._session_handle = self.thrift_backend.open_session(
    130     session_configuration, catalog, schema
    131 )
    132 self.open = True
    133 logger.info("Successfully opened session " + str(self.get_session_id()))
&amp;nbsp;
File ~/project/python/venv/lib/python3.8/site-packages/databricks/sql/thrift_backend.py:444, in ThriftBackend.open_session(self, session_configuration, catalog, schema)
    435     initial_namespace = None
    437 open_session_req = ttypes.TOpenSessionReq(
    438     client_protocol_i64=ttypes.TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V5,
    439     client_protocol=None,
   (...)
    442     configuration=session_configuration,
    443 )
--&amp;gt; 444 response = self.make_request(self._client.OpenSession, open_session_req)
    445 self._check_initial_namespace(catalog, schema, response)
    446 self._check_protocol_version(response)
&amp;nbsp;
File ~/project/python/venv/lib/python3.8/site-packages/databricks/sql/thrift_backend.py:373, in ThriftBackend.make_request(self, method, request)
    371 error_info = response_or_error_info
    372 # The error handler will either sleep or throw an exception
--&amp;gt; 373 self._handle_request_error(error_info, attempt, elapsed)
&amp;nbsp;
File ~/project/python/venv/lib/python3.8/site-packages/databricks/sql/thrift_backend.py:241, in ThriftBackend._handle_request_error(self, error_info, attempt, elapsed)
    236     network_request_error = RequestError(
    237         user_friendly_error_message, full_error_info_context, error_info.error
    238     )
    239     logger.info(network_request_error.message_with_context())
--&amp;gt; 241     raise network_request_error
    243 logger.info(
    244     "Retrying request after error in {} seconds: {}".format(
    245         error_info.retry_delay, full_error_info_context
    246     )
    247 )
    248 time.sleep(error_info.retry_delay)
&amp;nbsp;
RequestError: Error during request to server&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried with the proxy setting along with the http_headers&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  connection = sql.connect(
  server_hostname ='adb-random12094383.azuredatabricks.net', 
  http_path       ='/sql/1.0/endpoints/randomid', 
  access_token='&amp;lt;access token here&amp;gt;',
  http_headers= [("https_proxy", "proxy.mydomain.com:912"), ("http_proxy", "proxy.mydomain.com:912")]
  )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Still it fails with the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to pass the proxy setting to the Databricks Python SQL connector?&lt;/P&gt;</description>
    <pubDate>Thu, 25 Aug 2022 12:52:35 GMT</pubDate>
    <dc:creator>venkad</dc:creator>
    <dc:date>2022-08-25T12:52:35Z</dc:date>
    <item>
      <title>Passing proxy configurations with databricks-sql-connector python?</title>
      <link>https://community.databricks.com/t5/data-engineering/passing-proxy-configurations-with-databricks-sql-connector/m-p/33432#M24429</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to connect to databricks workspace which has IP Access restriction enabled using databricks-sql-connector. Only my Proxy server IPs are added in the allow list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;from databricks import sql
&amp;nbsp;
connection = sql.connect(
  server_hostname ='adb-random12094383.azuredatabricks.net', 
  http_path       ='/sql/1.0/endpoints/randomid', 
  access_token='&amp;lt;access token here&amp;gt;',
)
with connection.cursor() as cur:
  cur.execute('show schemas')
  print(cur.fetchall())&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This fails with the below error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;---------------------------------------------------------------------------
RequestError                              Traceback (most recent call last)
Input In [2], in &amp;lt;cell line: 1&amp;gt;()
----&amp;gt; 1 connection = sql.connect(
      2   server_hostname ='adb-2961643968016177.17.azuredatabricks.net', 
      3   http_path       ='/sql/1.0/endpoints/17a021e95a9e6f25', 
      4   access_token='dapi3d97e76ce3de34fb4ea060cf6b068e0a',
      5   http_headers= [("https_proxy", "http://proxy-dmz.intel.com:912"), ("http_proxy", "http://proxy-dmz.intel.com:912")]
      6   )
&amp;nbsp;
File ~/project/python/venv/lib/python3.8/site-packages/databricks/sql/__init__.py:50, in connect(server_hostname, http_path, access_token, **kwargs)
     47 def connect(server_hostname, http_path, access_token, **kwargs):
     48     from .client import Connection
---&amp;gt; 50     return Connection(server_hostname, http_path, access_token, **kwargs)
&amp;nbsp;
File ~/project/python/venv/lib/python3.8/site-packages/databricks/sql/client.py:129, in Connection.__init__(self, server_hostname, http_path, access_token, http_headers, session_configuration, catalog, schema, **kwargs)
    120 base_headers = [("User-Agent", useragent_header)] + authorization_header
    121 self.thrift_backend = ThriftBackend(
    122     self.host,
    123     self.port,
   (...)
    126     **kwargs
    127 )
--&amp;gt; 129 self._session_handle = self.thrift_backend.open_session(
    130     session_configuration, catalog, schema
    131 )
    132 self.open = True
    133 logger.info("Successfully opened session " + str(self.get_session_id()))
&amp;nbsp;
File ~/project/python/venv/lib/python3.8/site-packages/databricks/sql/thrift_backend.py:444, in ThriftBackend.open_session(self, session_configuration, catalog, schema)
    435     initial_namespace = None
    437 open_session_req = ttypes.TOpenSessionReq(
    438     client_protocol_i64=ttypes.TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V5,
    439     client_protocol=None,
   (...)
    442     configuration=session_configuration,
    443 )
--&amp;gt; 444 response = self.make_request(self._client.OpenSession, open_session_req)
    445 self._check_initial_namespace(catalog, schema, response)
    446 self._check_protocol_version(response)
&amp;nbsp;
File ~/project/python/venv/lib/python3.8/site-packages/databricks/sql/thrift_backend.py:373, in ThriftBackend.make_request(self, method, request)
    371 error_info = response_or_error_info
    372 # The error handler will either sleep or throw an exception
--&amp;gt; 373 self._handle_request_error(error_info, attempt, elapsed)
&amp;nbsp;
File ~/project/python/venv/lib/python3.8/site-packages/databricks/sql/thrift_backend.py:241, in ThriftBackend._handle_request_error(self, error_info, attempt, elapsed)
    236     network_request_error = RequestError(
    237         user_friendly_error_message, full_error_info_context, error_info.error
    238     )
    239     logger.info(network_request_error.message_with_context())
--&amp;gt; 241     raise network_request_error
    243 logger.info(
    244     "Retrying request after error in {} seconds: {}".format(
    245         error_info.retry_delay, full_error_info_context
    246     )
    247 )
    248 time.sleep(error_info.retry_delay)
&amp;nbsp;
RequestError: Error during request to server&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried with the proxy setting along with the http_headers&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  connection = sql.connect(
  server_hostname ='adb-random12094383.azuredatabricks.net', 
  http_path       ='/sql/1.0/endpoints/randomid', 
  access_token='&amp;lt;access token here&amp;gt;',
  http_headers= [("https_proxy", "proxy.mydomain.com:912"), ("http_proxy", "proxy.mydomain.com:912")]
  )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Still it fails with the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to pass the proxy setting to the Databricks Python SQL connector?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 12:52:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/passing-proxy-configurations-with-databricks-sql-connector/m-p/33432#M24429</guid>
      <dc:creator>venkad</dc:creator>
      <dc:date>2022-08-25T12:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Passing proxy configurations with databricks-sql-connector python?</title>
      <link>https://community.databricks.com/t5/data-engineering/passing-proxy-configurations-with-databricks-sql-connector/m-p/33434#M24431</link>
      <description>&lt;P&gt;Sorry. I couldn't understand it. The URL shared doesn't say anything about the proxy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you mean to set the proxy with the os environment variable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I couldn't set the proxy setting on the environment level. I want to set it only for this databricks SQL module alone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 11:46:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/passing-proxy-configurations-with-databricks-sql-connector/m-p/33434#M24431</guid>
      <dc:creator>venkad</dc:creator>
      <dc:date>2022-08-26T11:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Passing proxy configurations with databricks-sql-connector python?</title>
      <link>https://community.databricks.com/t5/data-engineering/passing-proxy-configurations-with-databricks-sql-connector/m-p/33435#M24432</link>
      <description>&lt;P&gt;`databricks-sql-connector` doesn't support HTTP proxies yet but the work is underway to implement it. Should be available in the next month or so. You can follow &lt;A href="https://github.com/databricks/databricks-sql-python/issues/22" alt="https://github.com/databricks/databricks-sql-python/issues/22" target="_blank"&gt;this issue&lt;/A&gt; on the open source repository for updates.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 14:56:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/passing-proxy-configurations-with-databricks-sql-connector/m-p/33435#M24432</guid>
      <dc:creator>susodapop</dc:creator>
      <dc:date>2022-08-26T14:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Passing proxy configurations with databricks-sql-connector python?</title>
      <link>https://community.databricks.com/t5/data-engineering/passing-proxy-configurations-with-databricks-sql-connector/m-p/33436#M24433</link>
      <description>&lt;P&gt;Thank you. I will follow this issue. Hope to get the update soon.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 09:24:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/passing-proxy-configurations-with-databricks-sql-connector/m-p/33436#M24433</guid>
      <dc:creator>venkad</dc:creator>
      <dc:date>2022-08-30T09:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Passing proxy configurations with databricks-sql-connector python?</title>
      <link>https://community.databricks.com/t5/data-engineering/passing-proxy-configurations-with-databricks-sql-connector/m-p/33433#M24430</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can pass the proxy settings following the steps mentioned here: &lt;A href="https://docs.databricks.com/dev-tools/python-sql-connector.html#insert-data" target="test_blank"&gt;https://docs.databricks.com/dev-tools/python-sql-connector.html#insert-data&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Also, would like to ask are you not importing the OS modules?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 15:47:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/passing-proxy-configurations-with-databricks-sql-connector/m-p/33433#M24430</guid>
      <dc:creator>Debayan</dc:creator>
      <dc:date>2022-08-25T15:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Passing proxy configurations with databricks-sql-connector python?</title>
      <link>https://community.databricks.com/t5/data-engineering/passing-proxy-configurations-with-databricks-sql-connector/m-p/120249#M46103</link>
      <description>&lt;P&gt;Is there any resolution for the above setting up proxy with databricks sql connector&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 15:50:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/passing-proxy-configurations-with-databricks-sql-connector/m-p/120249#M46103</guid>
      <dc:creator>ss2025</dc:creator>
      <dc:date>2025-05-26T15:50:22Z</dc:date>
    </item>
  </channel>
</rss>

