hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.47k stars 4.55k forks source link

SQL Managed Instance fails to create with "properties.dnsZonePartner is invalid" message #26514

Open tysimo opened 2 weeks ago

tysimo commented 2 weeks ago

Is there an existing issue for this?

Community Note

Terraform Version

1.7.5

AzureRM Provider Version

3.110.0

Affected Resource(s)/Data Source(s)

azurerm_mssql_managed_instance

Terraform Configuration Files

resource "azurerm_mssql_managed_instance" "sqlmi" {
  name                         = var.name
  resource_group_name          = var.resource_group
  location                     = var.location
  administrator_login          = var.admin_user
  administrator_login_password = var.admin_password
  license_type                 = var.license_type
  subnet_id                    = var.subnet_id
  sku_name                     = var.sku
  vcores                       = var.vcores
  storage_size_in_gb           = var.storage_size

  identity {
    type = "SystemAssigned"
  }

  tags = var.tags

  lifecycle {
    ignore_changes = [
      tags["CreatedOn"],
      tags["CreatedBy"],
      storage_size_in_gb,
      sku_name 
      ]
  }

  timeouts {
    create = "12h"
    delete = "12h"
    update = "4h"
  }
}

Debug Output/Panic Output

https://gist.githubusercontent.com/tysimo/ef3b541513ed56564ddfa8ba6e73b1e8/raw/fbc698f856abf7e1ed800f972826bb867b826cf6/gistfile1.txt

Expected Behaviour

SQL Managed Instance creates successfully.

Actual Behaviour

SQL Managed Instance fails to create with below error.

sql.ManagedInstancesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="LinkedInvalidPropertyId" Message="Property id '' at path 'properties.dnsZonePartner' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'."

Steps to Reproduce

Plan runs successfully.

Apply fails with below error. Failover Group is not configured for this SQL MI (dns_zone_partner_id is null).

sql.ManagedInstancesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="LinkedInvalidPropertyId" Message="Property id '' at path 'properties.dnsZonePartner' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'."

Important Factoids

Azure Commercial - East US

References

No response

tysimo commented 2 weeks ago

I actually get the same message when trying to create a SQL Managed Instance in East US from the Azure Portal. This could be a Azure platform issue.

sinbai commented 2 weeks ago

I actually get the same message when trying to create a SQL Managed Instance in East US from the Azure Portal. This could be a Azure platform issue.

Hi @tysimo thanks for this information. It is recommended contacting Microsoft Support for further help with this issue. So can we close this issue?

juanantoniofornericc commented 2 weeks ago

I was experiencing similar issue yesterday, today issue is gone, I did not apply any terraform code changes so it looks like it was an Azure platform issue.