Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
chetanhiwale
Resolver I
Resolver I

Spark streaming using Eventstream custom endpoint (Azure Event Hub)

I have created a Eventstream and using a custom endpoint as a source. Here my source is Azure Event hub. I am trying to read the data using spark streaming in Fabric notebook. Although I am able to start the spark stream, but not able to read any data. Is there setting enabled for custom endpoint like it can only listen to events. 

Event stream:

chetanhiwale_0-1745307664864.png

chetanhiwale_1-1745307692887.png


Pyspark code: 

from pyspark.sql import SparkSession
from pyspark.sql.functions import from_json, col
from pyspark.sql.types import StructType, StructField, StringType, IntegerType


# Event Hub connection string
event_hub_connection_string = "<Endpoint>"
 
# Read data from Event Hub
df = spark.readStream.format("eventhubs")\
  .options(**ehConf)\
  .load()  

rawData = df\
  .withColumn("bodyAsString", f.col("body").cast("string"))\
  .writeStream\
  .format("delta")\
  .option("checkpointLocation", "Files/checkpoint/stocks")\
  .outputMode("append")\
  .option("path", 'Tables/stock_events')

handler = rawData.start()
1 ACCEPTED SOLUTION
v-prasare
Community Support
Community Support

Hi @chetanhiwale,

Thanks for reaching out MS Fabric communnity support

custom endpoints in Eventstream are output-only, not sources. You cannot use Eventstream to feed Spark as a source. You either:

  • Connect Spark directly to Event Hub (bypass Eventstream)

  • Let Eventstream output to a Lakehouse or Delta, and Spark reads from that

 

Thanks,

Prashanth Are

View solution in original post

2 REPLIES 2
chetanhiwale
Resolver I
Resolver I

Thanks @v-prasare for sharing !!

 

v-prasare
Community Support
Community Support

Hi @chetanhiwale,

Thanks for reaching out MS Fabric communnity support

custom endpoints in Eventstream are output-only, not sources. You cannot use Eventstream to feed Spark as a source. You either:

  • Connect Spark directly to Event Hub (bypass Eventstream)

  • Let Eventstream output to a Lakehouse or Delta, and Spark reads from that

 

Thanks,

Prashanth Are

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Fabric Update Carousel

Fabric Monthly Update - February 2026

Check out the February 2026 Fabric update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors