Azurerm_linux_function_app | Support for Python >3.9?

Hi all!

I’m trying to create an Azure Function App using Terraform, and I’ve encountered an issue. When I specify python_version = 3.9, everything works fine. However, if I set python_version = 3.10, I receive the following error during terraform validate:

resource "azurerm_linux_function_app" "fa" {
  [...]

  site_config {
    application_stack {
      python_version = "3.10"
    }
  }
}

I’ve verified that creating this actual (i.e., with Python 3.10) Function App through the Azure portal works without any problems. I’m unsure why Terraform is giving me this error. Can someone help me understand what might be causing this error and how to resolve it? Thanks in advance!

Best,
Wessel

Hi @poppash,

I’m not familiar with this particular resource type but in the provider source code I see that there’s a validation rule constraining which versions of Python can be selected:

In the commit I linked to here 3.10 seems to already be supported, and so perhaps upgrading to a newer version of the provider will allow you to use 3.10 or 3.11.

The entry for 3.10 in particular seems to have been added in this pull request:

The commentary at the end of that PR suggests that it was released for the first time in v3.39.0 of hashicorp/azurerm.

I also see an open issue that seems to be asking the same thing as you did:

I suspect that this issue ought to have been closed but was forgotten because it was fixed as part of a big “rollup” PR that changed many things all at once. If you try this with provider version v3.39.0 or later then perhaps you could leave a note on that issue to let the maintainers know that it’s been fixed, so they can close the issue. Thanks!

Hi @apparentlymart,

Thanks - that indeed did the trick for me. Ouch - I feel a bit silly now. Note to self: pay attention to version numbers :upside_down_face:

I’ll leave a note, and perhaps update some docs.

Best,
Wessel