Troubleshoot Microsoft Fabric mirrored databases from Azure Cosmos DB (Preview)

Mirroring in Microsoft Fabric provides a seamless no-ETL experience to integrate your existing Azure Cosmos DB data with the rest of your data in Fabric. Use the tips in this article to help troubleshoot problems that you might experience when you create a mirrored database for Azure Cosmos DB in Fabric.

Important

Mirroring for Azure Cosmos DB is currently in preview. Production workloads aren't supported during preview. Currently, only Azure Cosmos DB for NoSQL accounts are supported.

Here's a list of common issues and relevant troubleshooting steps to follow if mirroring an Azure Cosmos DB database to Microsoft Fabric isn't working as expected.

Mirroring is failing when loading the databases with an "SQLAPIendpoint" error. How do I resolve this error?

This error typically indicates that your Azure Cosmos DB account key is no longer valid for the connection you selected. Once the connection credentials are updated with a valid account key, set up mirroring again.

Fabric is unable to configure mirroring with an error indicating that my Azure Cosmos DB account doesn't have continuous backup. How do I fix this error?

Enable continuous backup for your Azure Cosmos DB account. For more information, see create an Azure Cosmos DB account with continuous backup or migrate an existing Azure Cosmos DB account to continuous backup.

Once the continuous backup feature is enabled, return to the Fabric mirroring setup and continue with the remaining steps.

How do I know if my Azure Cosmos DB account has continuous backup enabled?

Using the Azure portal, you can check if the continuous backup feature is enabled by locating the Point in Time Restore option in the resource menu for the Azure Cosmos DB account. If this option isn't available, either the account doesn't have continuous backup enabled, or the account is migrating to continuous backup.

Enabling continuous backup in my Azure Cosmos DB account is causing various errors. Can I still set up Fabric mirroring?

No, Continuous backup must be enabled for Azure Cosmos DB accounts that are intended to be a mirroring source.

If there's an error message when enabling continuous backup for an Azure Cosmos DB account, the account might have limitations blocking the feature. For example, if you previously deleted analytical store for the account, the account can't support continuous backup. In this scenario, the only remaining option is to use a new Azure Cosmos DB account for mirroring.

Why is replication not working and I'm getting "internal server error" when I select "monitor replication"?

Replication could be working and you're observing a transient error if Azure Cosmos DB is throttling requests from Fabric. Additionally, there might be a limitation of mirroring with Azure Cosmos DB causing this issue. For more information, see Azure Cosmos DB mirroring limitations.

Refresh the Fabric portal and determine if the problem is automatically resolved. Also, you can stop and start replication. If none of these options work, open a support ticket.

How can I be sure Fabric is replicating data from Azure Cosmos DB?

First, follow general troubleshooting steps for Fabric mirrored databases. For more information, see troubleshooting.

In most cases, the Monitor replication option can provide further detail indicating whether data is replicating to Fabric successfully. A common troubleshooting step is to check if the last refreshed time is recent. If the time isn't recent, stop and then restart replication as the next step. Note, "last refreshed time" is only updated if the source database has changes since the time noted for replication. If the source database has no updates, deletes or inserts, "last refreshed time" will not be updated.

The "monitor replication" pane includes tables with no rows replicated after a significant amount of time. Is replication stuck?

Replication is likely stuck. Stop and restart replication as a first step. If this step doesn't work, open a support ticket.

Why can't I find any tables in the SQL analytics endpoint?

First, refresh the Schemas and dbo node to determine if the tables are ready. Tables are automatically loaded after they're ready. If no tables are ready after a significant amount of time, use the Monitor replication pane to determine if any replication errors occurred.

Why does my target warehouse tables only include the `_rid` column after replicating?

First, refresh the Schemas and dbo node to determine if the tables are ready. Tables are automatically loaded after they're ready. If more columns aren't ready after a significant amount of time, use the Monitor replication pane to determine if any replication errors occurred.

I added new items to a container in my Azure Cosmos DB database. These items aren't included in the results of my SQL analytics endpoint queries. How do I know if replication is working?

The Monitor replication option can provide further detail indicating whether data is replicating to Fabric successfully. A common troubleshooting step is to check if the last refreshed time is recent. If the time isn't recent, stop and then restart replication as the next step. If the time is recent, attempt your query again. Sometimes, there can be a delay between data being inserted into Azure Cosmos DB and it being replicated and available in Fabric.

If the data is still not available, use Lakehouse to create a shortcut and run a Spark query from a notebook. Spark always shows the latest data. If the data is available in Spark but not SQL analytics, open a support ticket.

If the data is also not available in Spark, there might be an unintended issue with replication latency. Wait for some time and retry replication. If problems persist, open a support ticket.

Why am I getting a "JSON text isn't properly formatted. Unexpected character '"' is found at position" error message when running T-SQL queries against my SQL analytics endpoint?

Data warehouse can't handle JSON string columns greater than 8 KB in size. Nested data represented as a JSON string in SQL analytics endpoint or warehouse tables can commonly cause the column to increase to more than 8 KB in size. Monitoring levels of nesting and the amount of data if you receive this error message. For more information, see data warehouse limitations.

Why am I getting an "Invalid column name" error in the "monitor replication" pane?

Mirroring doesn't support containers that contain items with property names containing either whitespaces or wild-card characters. This limitation causes mirroring for the specific container to fail. Other containers within the same databases can still successfully mirror. For more information, see replication limitations.