Hi
Thanks for the response. I had the correct target hostname. For who ever is facing this issue, this solution may be helpful in the future. Issue was with port #. Python SDK in Databricks by default is trying to connect to port 5671 or5672 using AMQP. Python standalone program ".py" on my local system is by default is connecting to 443 port. This issue was resolved by using additional parameter: transport_type. By default transport_type connects to 5671 or 5672 port. To override it to connect to 443, I used transport_type=TransportType.AmqpOverWebsocket
producer = EventHubProducerClient.from_connection_string(conn_str="Endpoint=sb://eventhubnamespace.servicebus.windows.net/;SharedAccessKeyName=saspolicyname;SharedAccessKey=saspolicykey", eventhub_name="ehname", transport_type=TransportType.AmqpOverWebsocket)
This following link has the details on port and firewall:
https://video2.skills-academy.com/en-us/azure/event-hubs/event-hubs-faq