Skip to content

Refresh of azurerm_kusto_database fails when cluster is stopped state #20633

@Matthijsy

Description

@Matthijsy

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.3.9

AzureRM Provider Version

3.25

Affected Resource(s)/Data Source(s)

azurerm_kusto_database

Terraform Configuration Files

terraform {
  required_providers {
    azurerm = "~> 3.25"
  }

  required_version = ">= 1.1.0"
}

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "main" {
  name     = "rg-adx-test"
  location = "West Europe"
}

resource "azurerm_kusto_cluster" "main" {
  name                = "adxtftest"
  location            = azurerm_resource_group.main.location
  resource_group_name = azurerm_resource_group.main.name
  auto_stop_enabled   = true

  trusted_external_tenants = []
  engine                   = "V3"
  disk_encryption_enabled  = true

  sku {
    name     = "Dev(No SLA)_Standard_E2a_v4"
    capacity = 1
  }
}

resource "azurerm_kusto_database" "database" {
  name                = "database"
  resource_group_name = azurerm_resource_group.main.name
  location            = azurerm_resource_group.main.location

  cluster_name     = azurerm_kusto_cluster.main.name
  hot_cache_period = "P60D"
}

Debug Output/Panic Output

Error: retrieving Database: (Name "database" / Cluster Name "adxtftest" / Resource Group "rg-adx-test"): kusto.DatabasesClient#Get: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="Cannot fetch databases while resource is in state 'Stopped'."

Expected Behaviour

Either the refresh is skipped, since we cannot read it when the cluster is stopped. Or the cluster is started before refreshing the state. Preferably this is configurable.

Actual Behaviour

When running terraform plan with the ADX cluster in a stopped state, the plan fails.

Steps to Reproduce

  1. Run terraform apply
  2. Shutdown the just created ADX cluster
  3. Run terraform plan

Important Factoids

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions