terraform-provider-azurerm: azurerm_mssql_virtual_machine: API returning 500's

Terraform (and AzureRM Provider) Version

Terraform: v0.12.28 AzureRM Provider: v2.18.0

Affected Resource(s)

azurerm_mssql_virtual_machine

Terraform Configuration Files

resource "azurerm_mssql_virtual_machine" "sqlvm" {
  virtual_machine_id               = azurerm_virtual_machine.vm.id
  sql_license_type                 = "AHUB"
  r_services_enabled               = false
  sql_connectivity_port            = 1433
  sql_connectivity_type            = "PRIVATE"
  sql_connectivity_update_password = var.password
  sql_connectivity_update_username = var.username

  tags = {
    client = var.client
  }

  auto_patching {
    day_of_week                            = "Sunday"
    maintenance_window_duration_in_minutes = 60
    maintenance_window_starting_hour       = 2
  }
}

Debug Output

https://gist.github.com/tysimo/af74b396e938fc8c6d0a11eb7481aa1f

Expected Behavior

Terraform plan completes successfully.

Actual Behavior

Terraform plan fails to refresh azurerm_mssql_virtual_machine resources.

Steps to Reproduce

  1. terraform plan

Important Factoids

Running in North Central US Azure region. Worked fine a little over a week ago. Possible api issue in Azure?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 5
  • Comments: 15 (1 by maintainers)

Most upvoted comments

@tombuildsstuff we are having a call with Azure support shortly, we believe we have traced the issue back to this commit https://github.com/terraform-providers/terraform-provider-azurerm/commit/6654794e18922c49fecb127221255e9bf9a3dfc3 that was made 4 days ago updating the azure-sdk-for-go v44.0.0 vs the previous version which was azure-sdk-for-go v43.2.0

Opened an issue in azure-sdk-for-go https://github.com/Azure/azure-sdk-for-go/issues/11575

cc @yutyang @tysimo

@doherty100 the Azure Support case number is 120071421002079.

hey @fnocera @tysimo

Thanks for opening this issue.

Taking a look into this this appears to be an internal server error repeatedly coming back from the Azure API here - as such Terraform is polling a number of times (3 from memory) to try and work around this, but we’re still getting a 500 “internal server error” back from the Azure API here.

Looking at the log files here, this is coming from the Get SqlVirtualMachine API - as such I’d suggest filing an issue with Microsoft Support here - unfortunately this isn’t something that we can fix within Terraform, but when the API is fixed this should continue working automatically.

Thanks!

We are also facing this issue in EastUS2, any guidance on how we can resolve? We currently cannot provision new environments because of this issue.

cc @yutyang

Resolved in westeurope region

I can confirm @doherty100 that it’s working on westcentralus. Just tried on France Central and it’s not working there yet

FYI fix being deployed, I tested it in westcentralus and working there. It will take some time for this to roll out to all Azure regions.

@yutyang thanks I’ve connected these support cases and azure engineering is aware of them. I believe a fix is being rolled out as we speak but it will take some time to percolate into all the azure global regions.