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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_function_app_function file updates should not ForceNew resource #17735

Open
1 task done
dav009 opened this issue Jul 25, 2022 · 1 comment
Open
1 task done
Labels

Comments

@dav009
Copy link

dav009 commented Jul 25, 2022

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

Description

Current behaviour

Whenever files declared in the file block changes, it triggers a deletion and a new resource creation (see code snippet below). This is troublesome for deployments. Also because this provider assumes the destruction of a function takes 30s, but more often than None, the function still exists by the time when creation is requested, resulting in errors.

Furthermore the AZ CLI is able to update this resource in place.

#聽Expected behaviour
Updating files should trigger an inplace update of this resource.

resource "azurerm_function_app_function" "trigger_function" {
  name            = ".."
  function_app_id =  "..."
  language        = "Python"
  file {
    name = "__init__.py"
    content = file("somepackage/__init__.py")
  }

  config_json = jsonencode({
    "scriptFile" : "__init__.py",
    "bindings" : [
      {
        "name" : "..",
        "type" : "blobTrigger",
        "direction" : "in",
        "path" : "a/{filename}.json",
        "connection" : "TriggerBucket"
      },
      {
        "name" : "..",
        "type" : "blob",
        "direction" : "out"
        "path" : "b/{filename}.json",
        "connection" : "TriggerBucket",
      }
    ]
  })
}

New or Affected Resource(s)/Data Source(s)

azurerm_function_app_function

Potential Terraform Configuration

No response

References

No response

@xiaxyi
Copy link
Contributor

xiaxyi commented Jul 26, 2022

@dav009 Thanks for this, may I know which cli command are you talking about? I didn't see any in-place update available in azure cli command list:https://docs.microsoft.com/en-us/cli/azure/functionapp/function?view=azure-cli-latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants