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

The FUNCTIONS_WORKER_RUNTIME and WEBSITE_NODE_DEFAULT_VERSION get removed on azurerm_windows_function_app_slot after apply #18947

Closed
1 task done
KenticoMartinS opened this issue Oct 24, 2022 · 6 comments

Comments

@KenticoMartinS
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.2

AzureRM Provider Version

3.26.0

Affected Resource(s)/Data Source(s)

azurerm_windows_function_app_slot

Terraform Configuration Files

provider "azurerm" {
  features {}
}

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

resource "azurerm_storage_account" "example" {
  name                = "martinsteststorage"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location

  account_tier             = "Standard"
  account_replication_type = "LRS"
}

resource "azurerm_service_plan" "example" {
  name = "martinstest01"

  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location

  os_type  = "Windows"
  sku_name = "Y1"
}

resource "azurerm_windows_function_app" "example" {
  name = "martinstest01"

  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location

  storage_account_name       = azurerm_storage_account.example.name
  storage_account_access_key = azurerm_storage_account.example.primary_access_key

  service_plan_id = azurerm_service_plan.example.id

  site_config {
    application_stack {
      node_version = "~16"
    }
  }
}

resource "azurerm_windows_function_app_slot" "example" {
  name            = "slot"
  function_app_id = azurerm_windows_function_app.example.id

  storage_account_name       = azurerm_storage_account.example.name
  storage_account_access_key = azurerm_storage_account.example.primary_access_key

  app_settings = {
    Test = "me"
  }

  site_config {
    application_stack {
      node_version = "~16"
    }

    # http2_enabled = true
  }
}

Debug Output/Panic Output

There is nothing in the log files or debug output. Terraform doesn't even know that those settings are missing.

Expected Behaviour

When multiple terraform apply occur on the azurerm_windows_function_app_slot resource, the WEBSITE_NODE_DEFAULT_VERSION and FUNCTIONS_WORKER_RUNTIME application settings should remain intact, if there were no changes.

Actual Behaviour

When the minimal Terraform configuration provided above, is run the first time, everything is correct. The slot has both settings with the correct values WEBSITE_NODE_DEFAULT_VERSION = "~16", FUNCTIONS_WORKER_RUNTIME = "node".

After the second terraform apply, when the http2_enabled is changed (or a new application setting is added), both settings are missing.

Steps to Reproduce

  1. Create infrastructure from the provided configuration
  2. Validate settings and their values
  3. Uncomment the http2_enabled line and run terraform apply again
  4. Both settings are missing

I highly suspect the following line of code. If it is compared to how the azurerm_windows_function_app works, there is probably redundant condition for changes in the application_stack. As they don't happen, those 2 settings are not added in the appSettings object.

Important Factoids

No response

References

No response

@xiaxyi
Copy link
Contributor

xiaxyi commented Oct 25, 2022

Thanks @KenticoMartinS for raising this issue, the fix is included in this pr:#18076

@KenticoMartinS
Copy link
Author

Hi,
is there any ETA for when this will be fixed? PR is already open for this issue and has been assigned to @jackofallops for over a month.

@xiaxyi
Copy link
Contributor

xiaxyi commented May 31, 2023

Hi @KenticoMartinS , the issue should be fixed, are you still seeing this issue? Let me know if you have any question. Thanks

@KenticoMartinS
Copy link
Author

Hi @xiaxyi,
I think we haven't been seeing this issue for a while. We use AzureRM in version 3.50 and everything seems ok.

@rcskosir
Copy link
Contributor

Thanks for taking the time to submit this issue. Based on the above comment, @KenticoMartinS is no longer seeing this issue as of v3.50. As such, I am going to mark this issue as closed.

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 May 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.