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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
chetanhiwale
Advocate II
Advocate II

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
Advocate II
Advocate II

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
December Fabric Update Carousel

Fabric Monthly Update - December 2025

Check out the December 2025 Fabric Holiday Recap!

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.