Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_app_service_virtual_network_swift_connection constantly tries to set a value of virtual_network_name in a Webapp #5464

Closed
vvietrov opened this issue Jan 21, 2020 · 4 comments · Fixed by #5823
Assignees
Milestone

Comments

@vvietrov
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

v0.12.19
v1.40.0

Affected Resource(s)

  • azurerm_app_service_virtual_network_swift_connection
  • azurerm_app_service

Terraform Configuration Files

resource "azurerm_resource_group" "rg" {
  name     = "rg"
  location = "eastus"
}

resource "azurerm_virtual_network" "vnet" {
  resource_group_name = azurerm_resource_group.rg.name
  location            = azurerm_resource_group.rg.location
  name                = "vnet"
  address_space       = ["10.0.0.0/16"]
}

resource "azurerm_subnet" "subnet" {
  name                 = "subnet"
  virtual_network_name = azurerm_virtual_network.vnet.name
  resource_group_name  = azurerm_resource_group.rg.name
  address_prefix       = "10.0.0.0/24"

  delegation {
    name = "delegation"

    service_delegation {
      name    = "Microsoft.Web/serverFarms"
      actions = ["Microsoft.Network/virtualNetworks/subnets/action"]
    }
  }
}

resource "azurerm_app_service_plan" "asp" {
  name                = "asp-test123"
  resource_group_name = azurerm_resource_group.rg.name
  location            = azurerm_resource_group.rg.location

  sku {
    tier = "Free"
    size = "F1"
  }
}

resource "azurerm_app_service" "app" {
  name                = "app-test0369"
  resource_group_name = azurerm_resource_group.rg.name
  location            = azurerm_resource_group.rg.location
  app_service_plan_id = azurerm_app_service_plan.asp.id
  https_only          = "true"

  site_config {
    php_version               = "5.6"
    default_documents         = ["Default.htm", "Default.html", "Default.asp", "index.htm", "index.html", "iisstart.htm", "default.aspx", "index.php", "hostingstart.html"]
    use_32_bit_worker_process = "true"
  }
}

resource "azurerm_app_service_virtual_network_swift_connection" "integration" {
  app_service_id = azurerm_app_service.app.id
  subnet_id      = azurerm_subnet.subnet.id
}

Debug Output

Panic Output

Expected Behavior

It is expected Terraform to create Vnet integration of the Webapp to the subnet, and it actually does this. But, on the second run it detects configuration drift within the Webapp config => Site settings => virtual_network_name. This happens every run. Could be a bug.

~ site_config {
always_on = false
default_documents = [
"Default.htm",
"Default.html",
"Default.asp",
"index.htm",
"index.html",
"iisstart.htm",
"default.aspx",
"index.php",
"hostingstart.html",
]
dotnet_framework_version = "v4.0"
ftps_state = "AllAllowed"
http2_enabled = false
ip_restriction = []
local_mysql_enabled = false
managed_pipeline_mode = "Integrated"
min_tls_version = "1.2"
php_version = "5.6"
remote_debugging_enabled = false
remote_debugging_version = "VS2019"
scm_type = "None"
use_32_bit_worker_process = true
- virtual_network_name = "c231c93d-9d9f-464d-987a-5fc34da0c2b9_subnet" -> null
websockets_enabled = false

Actual Behavior

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@vvietrov
Copy link
Author

Looks like the issue only happens when there is Site_Config {} block, even an empty one.

@rdbartram
Copy link
Contributor

I know this bug...really annoying but easily worked around with this.

lifecycle {
    ignore_changes = [
      site_config.0.virtual_network_name
    ]
}

@ghost
Copy link

ghost commented Feb 24, 2020

This has been released in version 2.0.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.0.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Mar 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants