Im using terraform 2.33.0 (I tested 2.90.0 too ) to create a sql server and then create a database
Today Ive started getting the following error:
Error waiting on create/update future for SQL Database "x" (Resource Group "y", Server "z"): Code="45157" Message="Server 'z' is busy with another operation. Please try your operation later.
I can create the sql database in the portal fine after this failure.
Has anybody seen this issue or anything like it?
The SQL Server is created like this:
resource "azurerm_sql_server" "tenant_sql" {
name = "fakename"
resource_group_name = azurerm_resource_group.tenant_rg.name
location = var.location
version = "12.0"
administrator_login = var.sql_server_admin_login
administrator_login_password = random_password.sql_server_admin_password.result
tags = {
Application = "blah"
Tenant = var.tenant
CustomerId = var.customer_id
Environment = var.environment
}
}
The db is created like this
resource "azurerm_sql_database" "tenant_sqldb" {
name = "x"
resource_group_name = azurerm_resource_group.tenant_rg.name
location = var.location
server_name = "fakename"
create_mode = "Default"
edition = var.database_is_premium == true ? "Premium" : "Standard"
requested_service_objective_name = var.database_is_premium == true ? "P4" : "S1"
max_size_bytes = 268435456000
tags = {
Application = "bah"
Tenant = var.tenant
CustomerId = var.customer_id
Environment = var.environment
}
}
This all executes as one script!
Its worth noting that azurem_sql_database is deprecated so perhaps the RM API behaviour has changed and azurem_sql_database isnt accounting for this.
zfully created before the database creation failed?