Forum Discussion
The issue of creating mirrored databases using APIs
- 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 LearnThe 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.
Hi,
Could you please post the entire json payload? Ensure you have the correct fabric permission.
if nothing works create support ticket.
- Jason_Xu10 months agoFrequent Visitor
Hi,
This is the code I used to create a mirror database using the API. I verified the status of the database and table, and it is valid