{"record":{"id":"d605985a86d1efcd","repo":"home-assistant/core","slug":"could-not-find-azure-data-explorer-database-or-tab","errorCode":null,"errorMessage":"Could not find Azure Data Explorer database or table","messagePattern":"Could not find Azure Data Explorer database or table","errorType":"exception","errorClass":"ConfigEntryError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/azure_data_explorer/__init__.py","lineNumber":78,"sourceCode":"\n    Adds an empty filter to hass data.\n    Tries to get a filter from yaml, if present set to hass data.\n    \"\"\"\n    if DOMAIN in yaml_config:\n        hass.data[DATA_COMPONENT] = yaml_config[DOMAIN].pop(CONF_FILTER)\n    else:\n        hass.data[DATA_COMPONENT] = FILTER_SCHEMA({})\n\n    return True\n\n\nasync def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:\n    \"\"\"Do the setup based on the config entry and the filter from yaml.\"\"\"\n    adx = AzureDataExplorer(hass, entry)\n    try:\n        await adx.test_connection()\n    except KustoServiceError as exp:\n        raise ConfigEntryError(\n            \"Could not find Azure Data Explorer database or table\"\n        ) from exp\n    except KustoAuthenticationError:\n        return False\n\n    entry.async_on_unload(adx.async_stop)\n    await adx.async_start()\n    return True\n\n\nasync def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:\n    \"\"\"Unload a config entry.\"\"\"\n    return True\n\n\nclass AzureDataExplorer:\n    \"\"\"A event handler class for Azure Data Explorer.\"\"\"\n","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/azure_data_explorer/__init__.py#L60-L96","documentation":"Raised as ConfigEntryError from the azure_data_explorer integration when adx.test_connection() (a Kusto query against the configured database/table) throws KustoServiceError — the Azure Data Explorer cluster accepted the connection attempt but the query/service failed: database or table not found, bad cluster URL, or a service-level error. Setup stops permanently (no retry) until the user fixes the config.","triggerScenarios":"test_connection() executes a sample query and Kusto returns an error entity: database name typo'd, table not created yet, cluster URI wrong (e.g. https://cluster.region.kusto.az ure.com mis-typed), or insufficient database-level permission producing a service error.","commonSituations":"Table not yet created by the user's setup script; database name case/typo; cluster URL from a different Azure environment; principal lost Reader/Database User rights.","solutions":["Verify the cluster URI, database, and table names in the config entry exactly match Azure (test with Kusto Explorer or the Kusto CLI: .show databases / table exists).","Create the target table if it does not exist yet, or point the integration at an existing one.","Ensure the app registration/user has at least Database User on the target database.","Re-run setup/reconfigure after fixing; ConfigEntryError will not retry on its own."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from azure.kusto.data import KustoClient, KustoConnectionStringBuilder\n\nasync def kusto_target_ok(cluster_url: str, database: str, table: str) -> bool:\n    kcb = KustoConnectionStringBuilder.with_aad_device_authentication(cluster_url)\n    client = KustoClient(kcb)\n    result = client.execute(database, f\".show table {table} schema\")\n    return not result.errors\n","typeGuard":null,"tryCatchPattern":"from azure.kusto.data.exceptions import KustoServiceError, KustoAuthenticationError\n\ntry:\n    await adx.test_connection()\nexcept KustoServiceError as err:\n    raise ConfigEntryError(\"Could not find Azure Data Explorer database or table\") from err\nexcept KustoAuthenticationError:\n    return False  # auth issue: surface re-auth instead","preventionTips":["Create the target table and verify names with a .show tables query before setup.","Copy the cluster URI directly from the Azure portal overview page.","Grant the principal Database User rights and re-test with a manual Kusto query."],"tags":["home-assistant","azure","kusto","data-explorer","config-entry"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}