Forum Discussion

Jason_Xu's avatar
Jason_Xu
Frequent Visitor
10 months ago
Solved

The issue of creating mirrored databases using APIs

Hello everyone, When I create a corresponding mirrored database for Azure SQL Database using the API (as referenced in the article "Items - Create Mirrored Database"), the mirrored database status i...
  • v-priyankata's avatar
    10 months ago

    Hi Jason_Xu 

    Thank you for reaching out to the Microsoft Fabric Forum Community.

    Troubleshoot Fabric Mirrored Databases From Azure SQL Database - Microsoft Fabric | Microsoft Learn

    The System Assigned Managed Identity (SAMI) of your Azure SQL logical server needs to be enabled, set as the primary identity, and have Read and Write permissions on the mirrored database in Fabric. When you create a mirror through the Fabric UI, these permissions are usually granted automatically. However, when creating it via the API, you might need to assign them manually or they may not be set up correctly. If the SAMI was ever disabled and then re-enabled, it becomes a new identity, so any previous permission grants will no longer be valid.

    For Azure SQL Database sources, mirroring relies on the change feed to read and synchronize changes. If the change feed isn’t enabled, or if there haven’t been any recent changes, the replication may show as Running but with no actual data movement. You can check whether the change feed is active and if there are any errors by querying these DMVs on the source database : SELECT * FROM sys.dm_change_feed_log_scan_sessions; SELECT * FROM sys.dm_change_feed_errors;

     

    Even if the data has landed in OneLake, the metadata might take some time to appear in the SQL analytics endpoint. You may need to manually trigger a metadata refresh (for example, by selecting Refresh in the Fabric portal). If the Monitor Replication pane doesn’t show a Last completed timestamp for a table, it means replication hasn’t started yet.

     

    If your JSON body especially the definition payload contains errors (like missing mounted tables or incorrect schema names), the mirror may not start properly. Always make sure to include the default schema if you want to preserve your schema structure.

     

    If your Fabric workspace capacity is paused, overloaded, or scaled down, replication can pause or fail to resume. Make sure your capacity is active and healthy before testing mirroring again.

     

    If I misunderstand your needs or you still have problems on it, please feel free to let us know. 

    Thanks.