Refresh SQL analytics endpoint Metadata REST API (Generally Available)
Last month we introduced the SQL analytics endpoint Metadata Sync REST API in preview, and we’re excited to announce that this API is now Generally available (GA). With this API you can programmatically trigger a refresh of your SQL analytics endpoint to keep tables in sync with any changes made in your lakehouse, native and mirrored databases, ensuring that you can keep your data up to date as needed. You can read more about the preview in our announcement blog.
What’s changed in GA:
With GA, the preview parameter is no longer required and the response structure has changed from a flat array ([{…}, {…}]) to a wrapped format:
{
“value”: [{…}, {…}]
}
We recommend updating your code to remove the preview flag and handle the new response format accordingly.
Example of SQL analytics endpoint Metadata REST API:
To use this feature, simply pass the workspace ID, SQL analytics endpoint ID, and the API will provide detailed synchronization status for each table, including start and end times, status, last successful sync time and any error messages if applicable. Here’s an example of how to refresh a specified SQL analytics endpoint in a workspace:
Request
POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/sqlEndpoints/{sqlEndpointId}/refreshMetadata
Sample response
{
"value": [
{
"tableName": "Table 1",
"startDateTime": "2025-02-04T22:29:12.4400865Z",
"endDateTime": "2025-02-04T22:29:12.4869641Z",
"status": "Success",
"lastSuccessfulSyncDateTime": "2024-07-23T14:28:23.1864319Z"
},
{
"tableName": "Table 2",
"startDateTime": "2025-02-04T22:29:13.4400865Z",
"endDateTime": "2025-02-04T22:29:13.4869641Z",
"status": "Failure",
"error": {
"errorCode": "AdalRetryException",
"message": "Couldn't run query. There is a problem with the Microsoft Entra ID token. Have the warehouse owner log in again. If they're unavailable, use the takeover feature."
},
"lastSuccessfulSyncDateTime": "2024-07-23T14:28:23.1864319Z"
},
{
"tableName": "Table 3",
"startDateTime": "2025-02-04T22:29:14.4400865Z",
"endDateTime": "2025-02-04T22:29:14.4869641Z",
"status": "NotRun",
"lastSuccessfulSyncDateTime": "2024-07-23T14:28:23.1864319Z"
}
]
}
To learn more about the REST API, visit the Fabric REST APIs docs and check out this GitHub page for a code sample. As always, we welcome your feedback and look forward to hearing how you are using this feature to enhance your workflows. Please submit any feedback or suggestions at Microsoft Fabric Ideas and stay tuned for more improvements coming soon.