Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Special holiday offer! You and a friend can attend FabCon with a BOGO code. Supplies are limited. Register now.

Reply
Jason_Xu
Frequent Visitor

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 is shown as running, and I can correctly see the tables to be mirrored. However, the status remains "running," and no data synchronization occurs successfully.As below shows.

Jason_Xu_0-1760065770514.png

 

And when I switch to configuring the mirrored database for the same database using the UI, I can quickly observe that the data has been synchronized.

Jason_Xu_1-1760065810962.png

The above two scenarios were tested separately without simultaneously performing mirror operations on a database.

What is the reason behind this? How can Isolve it?

 

1 ACCEPTED SOLUTION
v-priyankata
Community Support
Community Support

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.

View solution in original post

5 REPLIES 5
v-priyankata
Community Support
Community Support

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.

Hi @Jason_Xu 

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

@rubayatyasmin Thanks for the inputs.

I hope the information provided was helpful. If you still have questions, please don't hesitate to reach out to the community.

 

Hi @Jason_Xu 

Hope everything’s going smoothly on your end. I wanted to check if the issue got sorted. if you have any other issues please reach community.

 

rubayatyasmin
Super User
Super User

Hi, 
Could you please post the entire json payload? Ensure you have the correct fabric permission. 

if nothing works create support ticket.


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


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

Jason_Xu_0-1760317128848.png

Jason_Xu_1-1760317166671.pngJason_Xu_2-1760317178988.png

 

 

Helpful resources

Announcements
December Fabric Update Carousel

Fabric Monthly Update - December 2025

Check out the December 2025 Fabric Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors