Failed to create data history connection."error":{"code":"NotDatabaseAdmin","message":"Unable to access Azure Data Explorer cluster database because the identity of the Azure Digital Twins instance is not a database admin."}}

Leo 0 Reputation points
2023-04-19T19:23:39.1666667+00:00

User's image

Hi I want to create data history connection using azure digital instance but I cannot identify/resolve the problem at hand can anyone guide me through procedure to solve this problem.

Azure Digital Twins
Azure Digital Twins
An Azure platform that is used to create digital representations of real-world things, places, business processes, and people.
220 questions
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.
484 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Sander van de Velde 29,196 Reputation points MVP
    2023-04-20T06:42:51.0166667+00:00

    Hello @Leo,

    as the error message says:

    Unable to access Azure Data Explorer cluster database because the identity of the Azure Digital Twins instance is not a database admin

    The ADT runtime must be authorized by ADX to alter the database (add tables) and ingest data. Therefore, the identity behind the ADT runtime must have 'Database admin' rights.

    Please check this blog post regarding the background on how to set up the connection.

    You can try to fix this using this blog post (check the section about registering the managed identity of the Azure Function).


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.

    1 person found this answer helpful.
    0 comments No comments

  2. AshokPeddakotla-MSFT 27,876 Reputation points
    2023-04-20T09:36:41.6766667+00:00

    @Leo Welcome to Microsoft Q&A forum!

    Can you confirm if you have Database Admin role in the Azure Data Explorer cluster?

    User's image

    In order to set up a data history connection, your Azure Digital Twins instance must have the following permissions to access the Azure Data Explorer resources. This role enables Azure Digital Twins to configure the Azure Data Explorer database on your behalf (for example, creating a table in the database). These permissions can optionally be removed after data history is set up.

    • Azure Data Explorer cluster: Contributor (scoped to either the entire cluster or specific database)
    • Azure Data Explorer database principal assignment: Admin (scoped to the database being used)

    You can also add yourself as an AllDatabasesAdmin under Permissions in your Azure Data Explorer cluster. User's image

    Also, note that the cluster has public network access enabled. If the Azure Data Explorer cluster has public network access disabled, Azure Digital Twins will be unable to configure the tables and other required artifacts, and data history setup will fail.

    For more details, please refer to Azure Digital Twins data history (with Azure Data Explorer) and Create a data history connection for Azure Digital Twins

    Hope this helps. Do let us know if you need any further help.

    If the suggestions answers your query, do click Accept Answer and Yes. And, if you have any further queries do let us know.

    0 comments No comments