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

crash when provisioning app service #8992

Closed
ghost opened this issue Oct 22, 2020 · 2 comments · Fixed by #8993
Closed

crash when provisioning app service #8992

ghost opened this issue Oct 22, 2020 · 2 comments · Fixed by #8993

Comments

@ghost
Copy link

ghost commented Oct 22, 2020

This issue was originally opened by @ebryan9 as hashicorp/terraform#26677. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Terraform 0.13.5

...

Terraform Configuration Files

provider "azurerm" {
version = "=2.22.0"
features {}
}

terraform {

backend "azurerm" {

resource_group_name = "pd1_rsg_eu2_ucx-linux"

storage_account_name = "eu2pd1staucxtfstate"

container_name = "eu2pd1scucx"

key = "ucx-ui.tfstate"

}

}

resource "azurerm_app_service" "ucx_ui" {
name = local.service_name
location = local.location
resource_group_name = var.resource_group_name[terraform.workspace]
app_service_plan_id = var.app_service_plan_id[terraform.workspace]
https_only = true

site_config {
linux_fx_version = "DOCKER|${local.container_registry_name}.azurecr.io/ucx/ucx_ui:${var.ucx_image_version[terraform.workspace]}"
always_on = true
}

app_settings = {
"WEBSITES_ENABLE_APP_SERVICE_STORAGE" = "false"
"DOCKER_REGISTRY_SERVER_URL" = "https://${local.container_registry_name}.azurecr.io"
"DOCKER_REGISTRY_SERVER_USERNAME" = local.container_registry_name
"DOCKER_REGISTRY_SERVER_PASSWORD" = ""
"AzureAdB2C__Tenant" = var.b2c_tenant[terraform.workspace]
"AzureAdB2C__ClientId" = var.b2c_clientid[terraform.workspace]
"AzureAdB2C__Policy" = local.b2c_policy
#"ApplicationInsights__InstrumentationKey" = module.app_insights.instrumentation_key
}

logs {
http_logs {
file_system {
retention_in_days = 7
retention_in_mb = 35
}
}
}

lifecycle {
ignore_changes = [
tags,
]
}
}

resource "azurerm_app_service_slot" "ucx_ui_stage_slot" {
name = "stage"
app_service_name = local.service_name
location = local.location
resource_group_name = var.resource_group_name[terraform.workspace]
app_service_plan_id = var.app_service_plan_id[terraform.workspace]

depends_on = [
azurerm_app_service.ucx_ui,
]

site_config {
linux_fx_version = "DOCKER|${local.container_registry_name}.azurecr.io/ucx/ucx_ui:${var.ucx_image_version[terraform.workspace]}"
always_on = true
# auto_swap_slot_name = "production"
}

app_settings = {
"DOCKER_ENABLE_CI": "true",
"WEBSITES_ENABLE_APP_SERVICE_STORAGE": "false",
"DOCKER_REGISTRY_SERVER_PASSWORD": "",
"DOCKER_REGISTRY_SERVER_URL": "https://${local.container_registry_name}.azurecr.io",
"DOCKER_REGISTRY_SERVER_USERNAME": local.container_registry_name
}
}

resource "azurerm_app_service_active_slot" "ucx_ui_active_slot" {

resource_group_name = local.resource_group_name

app_service_name = local.service_name

app_service_slot_name = local.service_slot_name

}

resource "azurerm_storage_account" "storage-account" {
name = local.storage_account_name
resource_group_name = var.resource_group_name[terraform.workspace]
location = local.location
account_tier = "Standard"
account_replication_type = "LRS"
enable_https_traffic_only = true
allow_blob_public_access = false

network_rules {
	default_action = "Allow"
	bypass = ["AzureServices"]
}

}

resource "azurerm_storage_container" "terraform-container" {
name = local.storage_container_name
storage_account_name = azurerm_storage_account.storage-account.name
}

output "web_url" {
value = azurerm_app_service.ucx_ui.default_site_hostname
}

...

Debug Output

Crash Output

https://gist.github.com/ebryan9/29d537a7feb46fa395a1602df0c7e6eb

Expected Behavior

Create azurerm_storage_container when I execute terraform apply

Actual Behavior

terraform apply does not execute

Steps to Reproduce

  1. terraform init
  2. terraform plan -out state.tfplan
  3. `terraform apply state.tfplan

Additional Context

References

@ghost
Copy link
Author

ghost commented Oct 29, 2020

This has been released in version 2.34.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.34.0"
}
# ... other configuration ...

@ghost
Copy link
Author

ghost commented Nov 26, 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 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Nov 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant