Tech Talk

Manage Azure Data Explorer (ADX) with Terraform the Elegant Way

Manage Azure Data Explorer (ADX) with Terraform the Elegant Way
  • Christoph Thale

  • 6 min

  • June 19, 2023

The official Terraform azurerm provider works well for ADX clusters – but breaks down when managing data-plane artifacts like tables and materialized views. Here's the elegant alternative.

Why We Switched From the Official azurerm Provider to the Community ADX Provider

Azure Data Explorer is a powerful analytics hub. Managing its data-plane artifacts (tables, materialized views, update policies) with Terraform quickly becomes painful with the official azurerm provider.

The Problem With Kusto Scripts in azurerm

  • Hard limit of 50 Kusto Scripts per ADX cluster                                              
  • No stateful handling of changes within a script
  • On syntax error, Terraform removes the script from its state – breaking subsequent runs

The Elegant Alternative: Community ADX Provider

The favoretti/adx provider manages individual ADX artifacts as proper Terraform resources, with full CRUD support:

resource "adx_table" "test" 
{name= "Test1"   database_name = "test-db"   table_schema  = "Name:string,String:string,Counter:int"folder= "my/folder"   docstring     = "Entity description" }

 

With this provider you get clean plan output, stateful updates, and proper destroy behaviour when you remove a resource block.

Scope

The ADX provider handles the data plane (tables, materialized views, policies, etc.). Continue using azurerm for the control plane (clusters, databases, event hub connections, permissions).