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

azurerm_windows_web_app_slot does not support remote_debugging_version VS2022 (probably azurerm_linux_web_app_slot too) #26482

Open drdamour opened 2 weeks ago

drdamour commented 2 weeks ago

Is there an existing issue for this?

Community Note

MS recently deprecated 2017 and 2019 support https://techcommunity.microsoft.com/t5/apps-on-azure-blog/upcoming-changes-to-supported-versions-of-visual-studio-for/ba-p/4164389

so we tried to go to 2022 by setting our VS2017 stuff to VS2022 but it fails tf validation for azurerm_windows_web_app_slot (& i suspect azurerm_linux_web_app_slot)

may want to remove VS2017 and VS2019 support as azure rejects them now it seems.

Terraform Version

1.8.5

AzureRM Provider Version

3.109.0

Affected Resource(s)/Data Source(s)

azurerm_windows_web_app_slot

Terraform Configuration Files

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_service_plan" "example" {
  name                = "example-plan"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  os_type             = "Windows"
  sku_name            = "P1v2"
}

resource "azurerm_windows_web_app" "example" {
  name                = "example-windows-web-app"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_service_plan.example.location
  service_plan_id     = azurerm_service_plan.example.id

  site_config {}
}

resource "azurerm_windows_web_app_slot" "example" {
  name           = "example-slot"
  app_service_id = azurerm_windows_web_app.example.id

  site_config {
      remote_debugging_version  = "VS2022"
  }
}

Debug Output/Panic Output

╷
│ Error: expected site_config.0.remote_debugging_version to be one of ["VS2017" "VS2019"], got VS2022
│ 
│   with module.subject.azurerm_windows_web_app_slot.staging_slot,
│   on ../../../src/iac/az/main.tf line 2096, in resource "azurerm_windows_web_app_slot" "staging_slot":
│ 2096:     remote_debugging_version = "VS2022"
│ 
╵

Expected Behaviour

No response

Actual Behaviour

No response

Steps to Reproduce

No response

Important Factoids

No response

References

24405 & #18580 added it to the main web app resources, but not for the slots...same update is needed here i suspect

Chambras commented 2 weeks ago

@drdamour nice catch. I will try to send a PR to fix it.