Azure Data Explorer Database

This page shows how to write Terraform and Azure Resource Manager for Data Explorer Database and write them securely.

azurerm_kusto_database (Terraform)

The Database in Data Explorer can be configured in Terraform with the resource name azurerm_kusto_database. The following sections describe 5 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L2
resource "azurerm_kusto_database" "database" {
  name                = var.database_name
  resource_group_name = var.resource_group_name
  location            = var.resource_group_location
  cluster_name        = var.cluster_name

main.tf#L25
resource "azurerm_kusto_database" "database" {
  name                = "demo-database"
  resource_group_name = var.resource_group_name
  location            = var.resource_group_location
  cluster_name        = azurerm_kusto_cluster.cluster.name

azurerm-kusto.tf#L12
resource "azurerm_kusto_database" "database" {
  cluster_name        = azurerm_kusto_cluster.cluster.name
  location            = data.azurerm_resource_group.rg.location
  name                = var.database_name
  resource_group_name = data.azurerm_resource_group.rg.name
}
main.tf#L7
resource "azurerm_kusto_database" "this" {
  cluster_name        = var.cluster_name
  hot_cache_period    = var.hot_cache_period
  location            = var.location
  name                = var.name
  resource_group_name = var.resource_group_name
main.tf#L7
resource "azurerm_kusto_database" "this" {
  cluster_name        = var.cluster_name
  hot_cache_period    = var.hot_cache_period
  location            = var.location
  name                = var.name
  resource_group_name = var.resource_group_name

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a Kusto (also known as Azure Data Explorer) Database

Microsoft.Kusto/Clusters/Databases (Azure Resource Manager)

The Clusters/Databases in Microsoft.Kusto can be configured in Azure Resource Manager with the resource name Microsoft.Kusto/Clusters/Databases. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

KustoDatabasesListByCluster.json#L15
            "type": "Microsoft.Kusto/Clusters/Databases",
            "location": "westus",
            "properties": {
              "softDeletePeriod": "P1D",
              "provisioningState": "Succeeded"
            }
KustoDatabasesListByCluster.json#L15
            "type": "Microsoft.Kusto/Clusters/Databases",
            "etag": "W/\"datetime'2017-12-05T15%3A28%3A05.732611Z'\"",
            "location": "westus",
            "properties": {
              "softDeletePeriodInDays": 1,
              "provisioningState": "Succeeded"
KustoDatabasesListByCluster.json#L15
            "type": "Microsoft.Kusto/Clusters/Databases",
            "etag": "W/\"datetime'2017-12-05T15%3A28%3A05.732611Z'\"",
            "location": "westus",
            "properties": {
              "softDeletePeriodInDays": 1,
              "provisioningState": "Succeeded"
KustoDatabasesListByCluster.json#L15
            "type": "Microsoft.Kusto/Clusters/Databases",
            "etag": "W/\"datetime'2017-12-05T15%3A28%3A05.732611Z'\"",
            "location": "westus",
            "properties": {
              "softDeletePeriodInDays": 1,
              "provisioningState": "Succeeded"
KustoDatabasesListByCluster.json#L15
            "type": "Microsoft.Kusto/Clusters/Databases",
            "etag": "W/\"datetime'2017-12-05T15%3A28%3A05.732611Z'\"",
            "location": "westus",
            "properties": {
              "softDeletePeriodInDays": 1,
              "provisioningState": "Succeeded"
KustoEventHubConnectionsListByDatabase.json#L16
            "type": "Microsoft.Kusto/Clusters/Databases",
            "location": "westus",
            "properties": {
              "eventHubResourceId": "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1",
              "consumerGroup": "testConsumerGroup1"
            }
KustoEventHubConnectionsListByDatabase.json#L16
            "type": "Microsoft.Kusto/Clusters/Databases",
            "location": "westus",
            "properties": {
              "eventHubResourceId": "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1",
              "consumerGroup": "testConsumerGroup1"
            }
08_adx_rg.json#L40
      "type": "Microsoft.Kusto/Clusters/Databases"
    },
    {
      "apiVersion": "2020-02-15",
      "dependsOn": [
        "[resourceId('Microsoft.Kusto/Clusters', parameters('Clusters_adxvladris_name'))]"
KustoEventHubConnectionsListByDatabase.json#L16
            "type": "Microsoft.Kusto/Clusters/Databases",
            "location": "westus",
            "properties": {
              "eventHubResourceId": "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1",
              "consumerGroup": "testConsumerGroup1"
            }
KustoEventHubConnectionsListByDatabase.json#L16
            "type": "Microsoft.Kusto/Clusters/Databases",
            "location": "westus",
            "properties": {
              "eventHubResourceId": "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventHub/namespaces/eventhubTestns1/eventhubs/eventhubTest1",
              "consumerGroup": "testConsumerGroup1"
            }

Frequently asked questions

What is Azure Data Explorer Database?

Azure Data Explorer Database is a resource for Data Explorer of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure Data Explorer Database?

For Terraform, the prashant101386/devops, jittakal/tf-sample-template and cjthorpe/terraform-azure-code source code examples are useful. See the Terraform Example section for further details.

For Azure Resource Manager, the assing/alerts-extension, assing/alerts-extension and assing/alerts-extension source code examples are useful. See the Azure Resource Manager Example section for further details.