@Brünning, Georg To configure the SearchClient to use a proxy in a corporate network, you can use the AiohttpTransport
class from the azure.core.pipeline.transport
module instead of RequestsTransport
. Here's an example of how to set up the SearchClient
with proxy settings and handle SSL verification within a proxy environment:
from azure.core.pipeline.transport import AiohttpTransport
from azure.search.documents import SearchClient
from azure.core.credentials import AzureKeyCredential
proxy_settings = {
"http": "http://<proxy_host>:<proxy_port>",
"https": "https://<proxy_host>:<proxy_port>"
}
transport = AiohttpTransport(
proxies=proxy_settings,
ssl_verification=True
)
search_client = SearchClient(
endpoint=endpoint,
index_name=index_name,
credential=AzureKeyCredential(api_key),
transport=transport
)
In this example, replace <proxy_host>
and <proxy_port>
with the hostname and port number of your proxy server. The ssl_verification
parameter is set to True
to enable SSL verification within the proxy environment.
Regarding your question about why you are unable to import RequestsTransport
, it's because RequestsTransport
is not included in the azure.core.pipeline.transport
module. Instead, you can use AiohttpTransport
as shown in the example above