user15994794
user15994794

Reputation: 1

Error in create_authenticator when listening to Azure EventHub from organization network

I am trying to read from an Azure event hub using the below code. This code works fine when I am outside organization network, but with Pulse VPN or in org LAN network it fails with and authentication error. I have also tried giving the proxy but no luck. Read a solution about opening port 5672 and 5671. I am not sure where and how to do this, maybe in windows firewall? If so then this also does not work.

Installed: Python 3.9 and azure.eventhub==5.4.0

conn_str="Endpoint=sb://myeventhub.servicebus.windows.net/;EntityPath=xxxxxx;SharedAccessKeyName=listen;SharedAccessKey=xxxxxxxxxx"
client = EventHubConsumerClient.from_connection_string(conn_str=conn_str, consumer_group=consumer_group, http_proxy=HTTP_PROXY, https_proxy=HTTPS_PROXY)
partition_ids = client.get_partition_ids()

Error:

Traceback (most recent call last):
  File "C:\Python\lib\site-packages\uamqp\authentication\cbs_auth.py", line 69, in create_authenticator
    self._cbs_auth = c_uamqp.CBSTokenAuth(
  File ".\src/cbs.pyx", line 72, in uamqp.c_uamqp.CBSTokenAuth.__cinit__
ValueError: Unable to open CBS link.

Upvotes: 0

Views: 638

Answers (1)

Jesse Squire
Jesse Squire

Reputation: 7860

This indicates that the client was unable to connect to the Event Hubs namespace. If your organization allows unrestricted use of ports 80 and 443, you may want to consider using the web sockets transport when creating your client. This sample demonstrates passing configuration; line 43 is an example of setting the transport type, you'd want to change the type to TransportType.AmqpOverWebSocket.

Upvotes: 1

Related Questions