Forum Discussion
Refresh SQL Endpoint API
- 3 months ago
Hi todd-wilson,
v-echaithra is incorrect.
Refreshing the SQL Endpoint does update the data that is visible in the endpoint.
That was the entire point of the metadata refresh API.
Hi todd-wilson ,
Thanks for reaching out, this behavior is expected based on how the SQL analytics endpoint operates in Microsoft Fabric.
The Refresh SQL Endpoint Metadata API only synchronizes the metadata layer (tables, schema, object definitions) of the SQL endpoint with the underlying Lakehouse/Delta tables; it does not refresh or reload the actual data. As a result, even after data is committed to Delta via Spark, the SQL endpoint may still return stale results due to its decoupled and eventually consistent query layer, which can involve caching and asynchronous synchronization. This is why you’re observing a lag when querying the endpoint immediately after ingestion, even though querying Delta directly reflects the latest data.
To address this, there are two recommended approaches depending on your requirement.
Option 1 (preferred for deterministic scenarios): perform validations directly against the Lakehouse/Delta tables using Spark or Direct Lake, which guarantees immediate consistency after commit and avoids the SQL endpoint latency entirely.
Option 2 (if SQL endpoint must be used): introduce a controlled orchestration pattern, after writing data, call the metadata refresh API (if schema changes are involved), allow a short delay for the endpoint to synchronize, and for downstream consumers like Power BI, trigger a dataset refresh to ensure the latest data is picked up. This ensures more predictable behavior, although it still operates under eventual consistency rather than strict real time guarantees.
Hope this helps.
Chaithra E.