Forum Discussion

ToddChitt's avatar
ToddChitt
Icon for Super User rankSuper User
1 year ago
Solved

Semantic Model not reading Warehouse schema changes right away

I have a Semantic Model built on top of a Fabric Warehouse. This is NOT the Default Semantic Model. I make a change in the Warehouse by creating a VIEW (for some security testing purposes not releven...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi ToddChitt,

    Thanks for reaching out to the Microsoft fabric community forum.

     

    I encountered this issue as well and, after a thorough investigation, identified a reliable solution.

    When you create a new table or view in your Fabric Warehouse, it often doesn’t appear in your custom semantic model right away, even after selecting "Refresh Schema." This delay, which can last several minutes or longer, is due to Fabric caching metadata between the Warehouse and Semantic Model for performance reasons. As a result, schema changes may not show up immediately.

     

    To resolve this and have new objects appear instantly, follow these steps:

    1. Create your table or view in the Warehouse.
    2. Run a simple query against the new object, such as:

    SELECT TOP 1 * FROM sys.tables;

    3. Use the Fabric REST API to trigger a manual metadata refresh. For example, in Python:

    import sempy.fabric as fabric
    client = fabric.FabricRestClient()
    uri = f"/v1.0/myorg/lhdatamarts/{SQL_ENDPOINT_ID}"
    payload = {"commands": [{"$type": "MetadataRefreshCommand"}]}
    resp = client.post(uri, json=payload)

    Be sure to replace {SQL_ENDPOINT_ID} with your Warehouse SQL endpoint ID.

    4. Return to your Semantic Model, select Edit Tables > Refresh Schema, and your new table or view should appear immediately.

     

    If the response has addressed your query, please  "Accept it as a solution" and give a "Kudos"  so other members can easily find it.


    Best Regards,
    Tejaswi.
    Community Support