Data Flow source test connection to Cosmos DB fails with InvalidSubscriptionId error via Managed VNet Private Endpoint

Yeshwanth Reddy Sangam 0 Reputation points Microsoft Employee
2026-06-15T06:01:45.58+00:00

Azure Data Factory Data Flow fails to connect to Azure Cosmos DB (SQL API) when using Managed Virtual Network with a Managed Private Endpoint. The Copy Activity works correctly with the same linked service and private endpoint configuration.

Error Details:

  • Status code: 400
  • Error: {"error":{"code":"InvalidSubscriptionId","message":"The provided subscription identifier 'resourceGroups' is malformed or invalid."}}
  • This error occurs when testing connection from a Data Flow source, and during Data Flow debug/execution.
  • Tested after publishing as well

Behavior:

  1. Linked service "Test Connection" → SUCCEEDS ✓
  2. Copy Activity using same linked service → SUCCEEDS ✓
  3. Data Flow source using same linked service → FAILS ✗ (400 InvalidSubscriptionId)

This appears to be a bug in how the Data Flow Spark runtime resolves Cosmos DB resource IDs through Managed VNet private endpoints. The error suggests the resource path is being incorrectly parsed, with "resourceGroups" being interpreted as the subscription identifier.

Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.


1 answer

Sort by: Most helpful
  1. Yeshwanth Reddy Sangam 0 Reputation points Microsoft Employee
    2026-06-18T17:40:19.47+00:00

    It looks like the backend has been refreshed and the connection is now successful. Here are the steps I followed:

    1. Create a new linked service in ADF and make sure the following is included in the advanced JSON of linked service.
         {
          "properties": {
              "typeProperties": {
                  "subscriptionId": "<subscription-id>",
                  "tenantId": "<tenant-id>",
                  "resourceGroup": "<resource-group>"
              }
          }
      

    }

       
    

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.