# Function App Problems

**URL:** <https://discuss.hashicorp.com/t/function-app-problems/14851>\
**Category:** Azure\
**Tags:** azure\
**Created:** [September 29, 2020, 5:21pm UTC](https://discuss.hashicorp.com/t/function-app-problems/14851 "2020-09-29T17:21:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moojitsu](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/moojitsu/32/12207_2.png) [@Moojitsu](https://discuss.hashicorp.com/u/Moojitsu)\
**Post date:** [September 29, 2020, 5:21pm UTC](https://discuss.hashicorp.com/t/function-app-problems/14851/1 "2020-09-29T17:21:54Z")

</div>

I was trying to get a Function deployed to Azure and I found the following sample code in the documentation and I had modified it to match up with the names I was planning on using for my test deployment and it failed to run as it was presented in the documentation. As I received a message about an unsupported argument around the storage\_account\_name not being expected in the resource block.

I recently took the entire sample and tried to run it as is for a test and there the following errors popped up in the planning phase of the testing.

These were the errors:  
Error: Missing required argument

```
      on functionsample.tf line 30, in resource "azurerm_function_app" "example":
      30: resource "azurerm_function_app" "example" {

    The argument "storage_connection_string" is required, but no definition was
    found.

    Error: Unsupported argument

      on functionsample.tf line 35, in resource "azurerm_function_app" "example":
      35: storage_account_name = azurerm_storage_account.example.name

    An argument named "storage_account_name" is not expected here.

    Error: Unsupported argument

      on functionsample.tf line 36, in resource "azurerm_function_app" "example":
      36: storage_account_access_key = azurerm_storage_account.example.primary_access_key

    An argument named "storage_account_access_key" is not expected here.

```

This was the sample I was trying to get working in creating a function app in a consumption plan

```
resource "azurerm_resource_group" "example" {

```

name = “azure-functions-cptest-rg”  
location = “westus2”  
}

resource “azurerm\_storage\_account” “example” {  
name = “functionsapptestsa”  
resource\_group\_name = azurerm\_resource\_group.example.name  
location = azurerm\_resource\_group.example.location  
account\_tier = “Standard”  
account\_replication\_type = “LRS”  
}

resource “azurerm\_app\_service\_plan” “example” {  
name = “azure-functions-test-service-plan”  
location = azurerm\_resource\_group.example.location  
resource\_group\_name = azurerm\_resource\_group.example.name  
kind = “FunctionApp”

sku {  
tier = “Dynamic”  
size = “Y1”  
}  
}

resource “azurerm\_function\_app” “example” {  
name = “test-azure-functions”  
location = azurerm\_resource\_group.example.location  
resource\_group\_name = azurerm\_resource\_group.example.name  
app\_service\_plan\_id = azurerm\_app\_service\_plan.example.id  
storage\_account\_name = azurerm\_storage\_account.example.name  
storage\_account\_access\_key = azurerm\_storage\_account.example.primary\_access\_key  
}

I have searched high and low and have yet to find any answers in regards to creating a function app successfully in Azure.

---

<div class="post-metadata">

**Author:** ![BerimboloEnterprises](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/berimboloenterprises/32/15845_2.png) [@BerimboloEnterprises](https://discuss.hashicorp.com/u/BerimboloEnterprises)\
**Post date:** [December 16, 2020, 10:07am UTC](https://discuss.hashicorp.com/t/function-app-problems/14851/2 "2020-12-16T10:07:20Z")

</div>

Just wanted to say that this is the only entry I found on Google relating to this problem, and I’m having the same one.

---

<div class="post-metadata">

**Author:** ![sharebear](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/sharebear/32/15218_2.png) [@sharebear](https://discuss.hashicorp.com/u/sharebear)\
**Post date:** [December 16, 2020, 10:38am UTC](https://discuss.hashicorp.com/t/function-app-problems/14851/3 "2020-12-16T10:38:08Z")

</div>

> [@Moojitsu](#):
>
> This was the sample I was trying to get working in creating a function app in a consumption plan

My best guess is that you are using an old version of the azurerm provider somehow… how are you defining the azurerm provider version?

```hcl
terraform {
  required_version = "0.14.0"
  required_providers {
    azurerm = {
      source = "hashicorp/azurerm"
      version = "=2.38.0"
    }
  }
}

```

As a quick test, what do you get as output to terraform version?

```auto
terraform version
Terraform v0.14.0
+ provider registry.terraform.io/hashicorp/azurerm v2.38.0

Your version of Terraform is out of date! The latest version
is 0.14.2. You can update by downloading from https://www.terraform.io/downloads.html

```

---

<div class="post-metadata">

**Author:** ![BerimboloEnterprises](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/berimboloenterprises/32/15845_2.png) [@BerimboloEnterprises](https://discuss.hashicorp.com/u/BerimboloEnterprises)\
**Post date:** [December 16, 2020, 10:52am UTC](https://discuss.hashicorp.com/t/function-app-problems/14851/4 "2020-12-16T10:52:58Z")

</div>

Hi!

I just got the answer on Stack Overflow as well.

The problem was indeed an old version of the Azure provider. I was using v2.2.0. I was reading documentation for version 2.40.0 which contains changes from 2.2.0. It now works.

Thank you!

---

<div class="post-metadata">

**Author:** ![Moojitsu](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/moojitsu/32/12207_2.png) [@Moojitsu](https://discuss.hashicorp.com/u/Moojitsu)\
**Post date:** [January 14, 2021, 4:55pm UTC](https://discuss.hashicorp.com/t/function-app-problems/14851/5 "2021-01-14T16:55:03Z")

</div>

Sorry for the late response, with the holidays and being diverted to another project I somehow missed your response.

I did have an outdated version of Terraform and this was found discovered by running the test you had listed, now that I am coming back to this project after the holidays and I retested the template with the new version but got other errors due to some other depreciated functions within it I will need to update in order to fully test.

---

<div class="post-metadata">

**Author:** ![Moojitsu](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/moojitsu/32/12207_2.png) [@Moojitsu](https://discuss.hashicorp.com/u/Moojitsu)\
**Post date:** [January 14, 2021, 5:11pm UTC](https://discuss.hashicorp.com/t/function-app-problems/14851/6 "2021-01-14T17:11:26Z")

</div>

> [@sharebear](#):
>
> ```auto
> terraform {
> required_version = "0.14.0"
> required_providers {
> azurerm = {
> source = "hashicorp/azurerm"
> version = "=2.38.0"
> }
> }
> }
> 
> ```

I updated my providers declaration block to what you had listed and got it updated to the version of terraform I just downloaded but its giving me the following error:

Error: “features”: required field is not set

---

<div class="post-metadata">

**Author:** ![sharebear](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/sharebear/32/15218_2.png) [@sharebear](https://discuss.hashicorp.com/u/sharebear)\
**Post date:** [January 14, 2021, 5:24pm UTC](https://discuss.hashicorp.com/t/function-app-problems/14851/7 "2021-01-14T17:24:29Z")

</div>

> [@Moojitsu](#):
>
> Error: “features”: required field is not set

You need to specify a features block even if it is empty

```auto
provider "azurerm" {
  features {}
}

```

---

<div class="post-metadata">

**Author:** ![Moojitsu](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/moojitsu/32/12207_2.png) [@Moojitsu](https://discuss.hashicorp.com/u/Moojitsu)\
**Post date:** [January 14, 2021, 5:41pm UTC](https://discuss.hashicorp.com/t/function-app-problems/14851/8 "2021-01-14T17:41:44Z")

</div>

That worked, I only had one other depreciated thing that I was able to correct in regards to the connection string for the storage account tied to a function. I am off and running again just need to finish off the QNA settings like what the developers had manually created in development which is what I am trying to recreate via templates.
