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_windows_function_app not updating WEBSITE_CONTENTAZUREFILECONNECTIONSTRING when storage backend changes #22174

Closed
1 task done
dantape opened this issue Jun 14, 2023 · 2 comments · Fixed by #21212
Closed
1 task done

Comments

@dantape
Copy link

dantape commented Jun 14, 2023

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.4.6

AzureRM Provider Version

3.61.0

Affected Resource(s)/Data Source(s)

azurerm_windows_function_app

Terraform Configuration Files

provider "azurerm" {
  features {}
}

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

resource "azurerm_storage_account" "example" {
  name                     = "windowsfunctionappsa"
  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                = "example-app-service-plan"
  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                = "example-windows-function-app"
  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 {}
}

Debug Output/Panic Output

# azurerm_windows_function_app.example will be updated in-place
  ~ resource "azurerm_windows_function_app" "example" {
        id                                = ""
        name                              = "fa-ea2-12345678-poc"
      ~ storage_account_access_key        = (sensitive value)
      ~ storage_account_name              = "stea2funcstrg12345678" -> "stea2funcstrg87654321"

        # (22 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Expected Behaviour

The AzureWebJobsStorage and WEBSITE_CONTENTAZUREFILECONNECTIONSTRING app settings are both updated with the new storage account.

Actual Behaviour

Only AzureWebJobsStorage is updated and WEBSITE_CONTENTAZUREFILECONNECTIONSTRING retains the original value. This is a problem because the original storage account no longer exists.

Steps to Reproduce

  1. Create resources with terraform apply.
  2. Change the name of the storage account.
  3. Update resources with terraform apply.

Important Factoids

No response

References

This could be related to:
#21140
#21212

@rcskosir
Copy link
Contributor

@dantape Thank you for opening this issue. I agree with you that this issue is related to #21140 and believe #21212 will add the change you are looking for, so I have linked this issue to the PR.

Copy link

github-actions bot commented May 6, 2024

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 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants