Why does my ADF Lookup fail with an error mentioning the wrong database?

Molly Watson 96 Reputation points
2021-08-11T16:36:05.643+00:00

I'm trying to query a function in Azure Data Explorer using ADF. When I try to preview the data, I get the following error:

Error details
Error code: 11203
Details:
Read from Kusto failed with following error: Semantic error: Errors occurred while resolving remote entities.
Database='DB1': Access denied. Query: 'FunctionNameinDB2() | take 10'. Query: FunctionNameinDB2() | take 10. Semantic error: Errors occurred while resolving remote entities. Database='DB1': Access denied. Query: 'FunctionNameinDB2() | take 10' Activity ID: <guid>

The problem is that the function I'm querying isn't in DB1, it's in DB2. I've tried running other functions in other databases within the same Kusto cluster, and they work just fine!

Here's my (obfuscated) JSON for both the linked service and the dataset. Any thoughts?

Linked Service:
{
"name": "LinkedServiceName",
"properties": {
"description": "https://clustercontainingDB1andDB2.kusto.windows.net",
"annotations": [],
"type": "AzureDataExplorer",
"typeProperties": {
"endpoint": "https://clustercontainingDB1andDB2.kusto.windows.net",
"tenant": "<tenant_guid>",
"servicePrincipalId": "<spn_guid>",
"servicePrincipalKey": {
"type": "AzureKeyVaultSecret",
"store": {
"referenceName": "AKVName",
"type": "LinkedServiceReference"
},
"secretName": "secretname"
},
"database": "DB2"
},
"connectVia": {
"referenceName": "AutoResolveIntegrationRuntime",
"type": "IntegrationRuntimeReference"
}
}
}

Dataset:

{
"name": "DatesetName",
"properties": {
"linkedServiceName": {
"referenceName": "LinkedServiceName",
"type": "LinkedServiceReference"
},
"annotations": [],
"type": "AzureDataExplorerTable",
"schema": [],
"typeProperties": {
"table": "FunctionNameinDB2()"
}
}
}

Azure Data Explorer
Azure Data Explorer
An Azure data analytics service for real-time analysis on large volumes of data streaming from sources including applications, websites, and internet of things devices.
502 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,015 questions
{count} votes

Accepted answer
  1. Molly Watson 96 Reputation points
    2021-09-01T18:49:09.853+00:00

    I figured out why my ADF was giving me the (seemingly) inaccurate error it was!

    It turns out that FunctionNameinDB2() was making a call to DB1 in its function body, and the identity I was using didn't have access to DB1. Hence the error!

    Learn from my mistake: whenever using Kusto functions, be sure to check the function body to make sure your identity has access to all those clusters / DBs.

        // Kusto command to display function body / code
        .show function <FunctionName>
    

0 additional answers

Sort by: Most helpful