terraform-provider-azurerm
terraform-provider-azurerm copied to clipboard
[azurerm_linux_function_app] appsetting AzureWebJobsStorage will not stick
Is there an existing issue for this?
- [X] I have searched the existing issues
Community Note
I'm creating a linux function app that's using VNET integration and a storage share. This all works as expected, I also need to set AzureWebJobsStorage to the storage connection string as I think this is used for functions with a Timer trigger. When I apply this everything works, but on subsequent applies terraform always want to set AzureWebJobsStorage.
- Please vote on this issue by adding a :thumbsup: 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.2.3
AzureRM Provider Version
3.11.0
Affected Resource(s)/Data Source(s)
azurerm_linux_function_app
Terraform Configuration Files
terraform {
required_version = "1.2.3"
required_providers {
azurerm = {
version = "3.11.0"
source = "hashicorp/azurerm"
}
}
}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_storage_account" "example" {
name = "linuxfunctionappsa42"
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 = "Linux"
sku_name = "Y1"
}
resource "azurerm_linux_function_app" "example" {
name = "example-linux-function-app-42"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
storage_account_name = azurerm_storage_account.example.name
service_plan_id = azurerm_service_plan.example.id
app_settings = {
AzureWebJobsStorage = azurerm_storage_account.example.primary_connection_string
}
site_config {
}
}
Debug Output/Panic Output
n/a
Expected Behaviour
This should only apply once or be updated if changed by other means outside of terraform
Actual Behaviour
AzureWebJobsStorage is always showing changed when it hasn't been
Steps to Reproduce
terraform apply terraform apply
Important Factoids
No response
References
No response
Thanks @eltimmo , from my perspective, the property is not set back to the state, I'll have a further investigation and try the fix if the investigation result shows it a TF bug.
Thanks @eltimmo for raising this issue. the storage account related properties are exposed to below properties in root schema.TF provider will handle the app setting by checking these values. can you try specifying them and see if issue can be resolved?
storage_account_name
storage_account_access_key
storage_key_vault_secret_id
Hi @eltimmo , good day. just would like to follow up with you to see if you tried to use the storage related properties mentioned in my last comment?
Hi @xiaxyi, I've just re-tested this on 3.37 just using the storage_account_name and storage_account_access_key properties and removing AzureWebJobsStorage and the provider is working as expected.
I've used storage_key_vault_secret_id in another deployment, I can confirm that is working as expected using a reference for the storage connection string.
Thanks for looking at this.
Thanks @eltimmo for the clarification, glad to see it works out! For us to better manage the GH issue list, would you mind closing this issue? Feel free to let me know if you have any other question that I can help to address. :)
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.