Skip to content

[AVM Module Issue]: Unable to set Kusto Dababase Location #6496

@StevenU8

Description

@StevenU8

Check for previous/existing GitHub issues

  • I have checked for previous/existing GitHub issues

Issue Type?

Bug

Module Name

avm/res/kusto/cluster

(Optional) Module Version

0.9.0

Description

Issue

When deploying a Kusto Cluster and Database in a region that is different than the region set on the Resource Group, the deployment fails.

Repro Steps

  • Resource Group deployed in westus
  • Using the AVM module, attempt to deploy a Kusto cluster in eastus with a single database

Expected

  • Kusto Cluster deploys in eastus
  • Kusto Database deploys in eastus

Actual

  • Kusto Cluster deploys in eastus
  • Kusto Database attempts to deploy to westus due to Resource Group location instead of eastus based on cluster location.

Reason for failure

The location parameter set on the cluster is not passed down to the database. Instead, the database defaults to the Resource Group's location. The database.bicep file already exposes a location parameter, so I believe all that is needed is to pass the location from the cluster to the database. Example of code change required.

module kustoCluster_databases 'database/main.bicep' = [
  for (database, index) in (databases ?? []): {
    name: '${uniqueString(deployment().name, location)}-kustoCluster-database-${index}'
    params: {
      name: database.name
      kustoClusterName: kustoCluster.name
      location: location
      databaseKind: database.kind
      databaseReadWriteProperties: database.kind == 'ReadWrite' ? database.readWriteProperties : null
      databasePrincipalAssignments: database.databasePrincipalAssignments
    }
  }
]

Example diff: main...StevenU8:bicep-registry-modules:patch-1

(Optional) Correlation Id

No response

Metadata

Metadata

Assignees

Type

No type

Projects

Status

In Development

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions