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

Initial Creation of resource "azurerm_windows_web_app_slot" forces it to be created as 32 bit, regardless of setting "use_32_bit_worker" to false #19765

Closed
1 task done
JTYoung-github opened this issue Dec 21, 2022 · 2 comments · Fixed by #20051
Labels

Comments

@JTYoung-github
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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 Version

1.3.6

AzureRM Provider Version

3.36.0

Affected Resource(s)/Data Source(s)

azurerm_windows_web_app_slot

Terraform Configuration Files

terraform {
    required_providers {
      azurerm = {
        source  = "hashicorp/azurerm"
        version = ">=3.0.0"
      }  
    }
  }

provider "azurerm" {
  features {}
}


#variables
variable "Location" {
  type    = string
  default = "westeurope"
}

variable "Tags" {
  type = map
  default = {
    "Permanent or Temporary" = "Temporary"
    "Jira ticket" = "SlotBug-ticket"
    "System" = "AzureApp_Slot"
  }
}


resource "azurerm_resource_group" "RG" {
    name     = "Slotbug-RG" 
    location = var.Location
    tags = var.Tags    
}

resource "azurerm_service_plan" "ASP" {
  name                = "Slotbug-ASP" 
  location            = azurerm_resource_group.RG.location
  resource_group_name = azurerm_resource_group.RG.name

  os_type             = "Windows"
  sku_name            = "S1"
  tags = var.Tags

}

resource "azurerm_windows_web_app" "WA" {
  name                = "Slotbug-WA"
  location            = azurerm_resource_group.RG.location
  resource_group_name = azurerm_resource_group.RG.name
  service_plan_id     = azurerm_service_plan.ASP.id
  tags = var.Tags

  site_config {
      application_stack{
        current_stack = "dotnet"
        dotnet_version = "v6.0"
      }
      always_on                = false
      ftps_state               = "AllAllowed"
      use_32_bit_worker        = false
      default_documents           = [
      "Default.htm",
      "Default.html",
      "Default.asp",
      "index.htm",
      "index.html",
      "iisstart.htm",
      "default.aspx",
      "index.php",
      "hostingstart.html",
      ]
  }
}


resource "azurerm_windows_web_app_slot" "WASlot" {
  name                = "Slotbug-Slot"
  app_service_id      = azurerm_windows_web_app.WA.id
  tags = var.Tags

  site_config {
      application_stack{
        current_stack = "dotnet"
        dotnet_version = "v6.0"
      }
      always_on                = false
      ftps_state               = "AllAllowed"
      use_32_bit_worker        = false
      default_documents           = [
      "Default.htm",
      "Default.html",
      "Default.asp",
      "index.htm",
      "index.html",
      "iisstart.htm",
      "default.aspx",
      "index.php",
      "hostingstart.html",
      ]
  }
}

Debug Output/Panic Output

# terraform plan # Slot resource before building the web App and slot
# azurerm_windows_web_app_slot.WASlot will be created
  + resource "azurerm_windows_web_app_slot" "WASlot" {
      + app_service_id                    = (known after apply)
      + client_affinity_enabled           = false
      + client_certificate_enabled        = false
      + client_certificate_mode           = "Required"
      + custom_domain_verification_id     = (sensitive value)
      + default_hostname                  = (known after apply)
      + enabled                           = true
      + https_only                        = false
      + id                                = (known after apply)
      + key_vault_reference_identity_id   = (known after apply)
      + kind                              = (known after apply)
      + name                              = "Slotbug-Slot"
      + outbound_ip_address_list          = (known after apply)
      + outbound_ip_addresses             = (known after apply)
      + possible_outbound_ip_address_list = (known after apply)
      + possible_outbound_ip_addresses    = (known after apply)
      + site_credential                   = (known after apply)
      + tags                              = {
          + "Jira ticket"            = "SlotBug-ticket"
          + "Permanent or Temporary" = "Temporary"
          + "System"                 = "AzureApp_Slot"
        }
      + zip_deploy_file                   = (known after apply)

      + auth_settings {
          + additional_login_parameters    = (known after apply)
          + allowed_external_redirect_urls = (known after apply)
          + default_provider               = (known after apply)
          + enabled                        = (known after apply)
          + issuer                         = (known after apply)
          + runtime_version                = (known after apply)
          + token_refresh_extension_hours  = (known after apply)
          + token_store_enabled            = (known after apply)
          + unauthenticated_client_action  = (known after apply)

          + active_directory {
              + allowed_audiences          = (known after apply)
              + client_id                  = (known after apply)
              + client_secret              = (sensitive value)
              + client_secret_setting_name = (known after apply)
            }

          + facebook {
              + app_id                  = (known after apply)
              + app_secret              = (sensitive value)
              + app_secret_setting_name = (known after apply)
              + oauth_scopes            = (known after apply)
            }

          + github {
              + client_id                  = (known after apply)
              + client_secret              = (sensitive value)
              + client_secret_setting_name = (known after apply)
              + oauth_scopes               = (known after apply)
            }

          + google {
              + client_id                  = (known after apply)
              + client_secret              = (sensitive value)
              + client_secret_setting_name = (known after apply)
              + oauth_scopes               = (known after apply)
            }

          + microsoft {
              + client_id                  = (known after apply)
              + client_secret              = (sensitive value)
              + client_secret_setting_name = (known after apply)
              + oauth_scopes               = (known after apply)
            }

          + twitter {
              + consumer_key                 = (known after apply)
              + consumer_secret              = (sensitive value)
              + consumer_secret_setting_name = (known after apply)
            }
        }

      + site_config {
          + always_on                               = false
          + auto_heal_enabled                       = false
          + container_registry_use_managed_identity = false
          + default_documents                       = [
              + "Default.htm",
              + "Default.html",
              + "Default.asp",
              + "index.htm",
              + "index.html",
              + "iisstart.htm",
              + "default.aspx",
              + "index.php",
              + "hostingstart.html",
            ]
          + detailed_error_logging_enabled          = (known after apply)
          + ftps_state                              = "AllAllowed"
          + health_check_eviction_time_in_min       = (known after apply)
          + http2_enabled                           = false
          + ip_restriction                          = (known after apply)
          + load_balancing_mode                     = "LeastRequests"
          + local_mysql_enabled                     = false
          + managed_pipeline_mode                   = "Integrated"
          + minimum_tls_version                     = "1.2"
          + remote_debugging_enabled                = false
          + remote_debugging_version                = (known after apply)
          + scm_ip_restriction                      = (known after apply)
          + scm_minimum_tls_version                 = "1.2"
          + scm_type                                = (known after apply)
          + scm_use_main_ip_restriction             = false
          + use_32_bit_worker                       = false
          + vnet_route_all_enabled                  = false
          + websockets_enabled                      = false
          + windows_fx_version                      = (known after apply)
          + worker_count                            = (known after apply)

          + application_stack {
              + current_stack  = "dotnet"
              + dotnet_version = "v6.0"
            }
        }
    }




# terraform plan # Slot resource, after building the web app and slot
 azurerm_windows_web_app_slot.WASlot will be updated in-place
  ~ resource "azurerm_windows_web_app_slot" "WASlot" {
        id                                = "/subscriptions/d3f6d0b5-2962-4339-8f07-cba833e94e58/resourceGroups/Slotbug-RG/providers/Microsoft.Web/sites/Slotbug-WA/slots/Slotbug-Slot"
        name                              = "Slotbug-Slot"
        tags                              = {
            "Jira ticket"            = "SlotBug-ticket"
            "Permanent or Temporary" = "Temporary"
            "System"                 = "AzureApp_Slot"
        }
        # (16 unchanged attributes hidden)

      ~ site_config {
          ~ use_32_bit_worker                       = true -> false
            # (21 unchanged attributes hidden)

          - virtual_application {
              - physical_path = "site\\wwwroot" -> null
              - preload       = false -> null
              - virtual_path  = "/" -> null
            }

            # (1 unchanged block hidden)
        }

        # (1 unchanged block hidden)
    }

Expected Behaviour

the created resource for azurerm_windows_web_app_slot, is configured with use_32_bit_worker = false, and configures the platform as 64 bit on Azure

Actual Behaviour

the created resource for azurerm_windows_web_app_slot, is configured with use_32_bit_worker = false, but still configures the platform as 32 bit on Azure.
When running the terraform plan, post initial deployment, It will show you that it will update use_32_bit_worker = true for the next build

Steps to Reproduce

terraform init
terraform plan -out plan.tfplan
terraform apply plan.tfplan

terraform plan -out plan.tfplan

Important Factoids

No response

References

No response

@xiaxyi
Copy link
Contributor

xiaxyi commented Dec 22, 2022

Thanks @JTYoung-github for raising this issue, as we are making some changes to the app service resource and you can refer to pr #19685 for more information, to avoid some discrepancies, I'm afraid the fix to this issue may start once that pr get merged.

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants