I am trying to deploy to azure the following resource:
- mssql server
- mssql database
- mssql elastic pool
as you can see from the following terraform code:
resource "azurerm_mssql_server" "server" {
administrator_login = ""
administrator_login_password = ""
location = var.location
name = "server"
resource_group_name = azurerm_resource_group.resource-group.name
version = "12.0"
}
resource "azurerm_mssql_elasticpool" "sql-elasticpool" {
location = var.location
name = "sql-elasticpool"
resource_group_name = azurerm_resource_group.resourcegroup.name
server_name = azurerm_mssql_server.server.name
max_size_gb = 4.8828125
sku {
capacity = 50
name = "BasicPool"
tier = "Basic"
}
per_database_settings {
max_capacity = 5
min_capacity = 0
}
}
resource "azurerm_mssql_database" "database" {
name = "database"
server_id = azurerm_mssql_server.server.id
elastic_pool_id = azurerm_mssql_elasticpool.sql-elasticpool.id
}
when i run this terraform file, i get the following error
Error: waiting for create/update of Database: (Name "database" / Server Name "server" / Resource Group "resource group"): Code="ElasticPoolSkuCombinationInvalid" Message="Elastic pool 'sql-elasticpool' and sku 'Basic' combination is invalid."
both, database and elastic pool are on a Basic Sku. Initially i thought that the issue was a conflict between database and elastic, so i omitted the Sku from the sql database, but still the same issue. Can please anyone help to understand what i am doing wrong here please?
Check the following code.
With same code in my region (eastus), the resources got deployed successfully:
According to Microsoft.Sql/servers/elasticPools 2021-02-01-preview - Bicep, ARM template & Terraform AzAPI reference | Microsoft Learn
az sql elastic-pool list-editions -l <location> -o tableIn eastus I have support to Below skus of basic pool
To resolve this issue, try using a different SKU for the elastic pool where the selected SKU is available in the region where the resource is deployed.
Reference : Sql Database Elastic pool and sku combination is invalid | StackOverflow