Forum Discussion
Send data through TCP to a external server
Hi Anonymous
At this time, we are reaching out to the internal team to get some help on this .
We will update you once we hear back from them.
Appreciate your patience.
Thanks.
Hi Anonymous
I have received an update from the internal team as follows:
"We cannot just push to an unauthenticated TCP port when using Fabric". But one option if you just need to sent some text to an endpoint would be to use an event stream. You can use a custom app endpoint. You can treat this like an eventhub, AQMP or Kafka endpoint.
Please refer for more details: Add a custom app source to an eventstream - Microsoft Fabric | Microsoft Learn
I hope this information helps.
Thank you.
- v-cboorla-msft2 years agoMicrosoft Employee
Hi Anonymous
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others.
Otherwise, will respond back with the more details and we will try to help.Thanks.
- v-cboorla-msft2 years agoMicrosoft Employee
Hi Anonymous
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others .
If you have any question relating to the current thread, please do let us know and we will try out best to help you.
In case if you have any other question on a different issue, we request you to open a new thread.Thanks.
- Anonymous2 years agoNot applicable
Hello,
Thank you for your response. However, I need more detailed information on how to use an event stream for sending a text message.
Currently, I am generating the text for the message using a pipeline, as shown in the image below:
I tried sending the message using a Notebook with the following code:mensaje_tcp = "Hello Server!" ## The message would be the variable introduced in the notebookhost = "tcpbin.com" ## public tcp server for testingport = 4242import socket
def send_message_tcp(message, host, port😞with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:# Configure timeouts.settimeout(60) # 60 segundos de timeout# Connect to the servers.connect((host, port))try:# Send the messages.sendall(message.encode())# Receive the responseresponse = s.recv(1024) # Adjust buffer size as neededprint("Response:", response.decode())if response:print("Mensaje enviado correctamente.")else:print("Error: No se recibió respuesta del servidor.")raise Exception(f"ERROR: No se recibió respuesta del servidor.")except socket.timeout:print("Error: tiempo de espera agotado. No se recibió respuesta del servidor.")raise Exception(f"ERROR: Tiempo de espera agotado. No se recibió respuesta del servidor.")# Envío TCPsend_message_tcp(mensaje_tcp, host, port)Initially, this worked, but it has since stopped working, and I'm not sure why.
Could you please provide guidance on how to integrate this process with a stream? I assume the pipeline would need to send the generated text to the stream, and then maybe an Azure Function would consume the stream and forward the text to the TCP destination.
f that's the case, can the Azure Function send data to an unauthenticated TCP server?Thank you for your assistance.