Forum Discussion

Bill_J99294's avatar
Bill_J99294
Regular Visitor
1 year ago
Solved

Fabric Lakehouse SQL Endpoint Automatic Refresh

Hello,    Recently we have noticed that the automatic metadata discovery for our lakehouse has not been working. This has resulted in us manually refreshing the SQL endpoint for our Lakehouse each ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Bill_J99294 ,

     

    You can create a notebook that connects to the lakehouse corresponding to your SQL endpoint by entering the following command in the cell:

    from pyspark.sql import SparkSession
    
    # create Spark session
    spark = SparkSession.builder \
        .appName(“Refresh SQL Endpoint Metadata”) \
        .getOrCreate()
    
    # refresh
    spark.sql(“REFRESH TABLE salesorders”)
    
    print(“Metadata refresh triggered successfully.”)

     

    Set up a daily refresh in your notebook settings so that this refresh command is executed every day.

     

    If you have any other questions please feel free to contact me.

     

    Best Regards,
    Yang
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!