I’m trying to query Azure Cosmos DB data using a serverless SQL pool in Synapse with OPENROWSET and Managed Identity authentication.
Previously, OPENROWSET with Managed Identity wasn’t supported, but according to the official documentation it should now be available: Query Azure Cosmos DB analytical store in serverless SQL pool using OPENROWSET.
However, I keep getting the following error:
Resolving CosmosDB path has failed with error 'Access to the database account 'mycosmosaccount' is forbidden.'
Steps I followed:
Enabled Azure Synapse Link on Cosmos DB.
Enabled Analytical Store on the required containers.
Assigned the Synapse Workspace Managed Identity to Cosmos DB with Reader role.
Since the Cosmos DB account is configured with private endpoints, I also set up network isolation for this account from the Synapse workspace as described here: Use analytical store with private endpoints.
Connected Synapse to Cosmos DB.
Ran the following query:
SELECT TOP 100 *
FROM OPENROWSET(
'CosmosDB',
'account=mycosmosaccount;database=test_db;region=eastus;AuthType=ManagedIdentity',
test_container
) AS container_alias;
Using credentials (with key), the query works fine.
Using Managed Identity, it fails with the error above.
Since there are no blogs or working examples available for this Managed Identity method, I’d like to confirm:
Am I missing a configuration step (role assignment, permissions, or networking)?
- Or is this feature still not fully supported even though the documentation says it is?