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_linux_function_app Storage options not working #19134

Closed
1 task done
rdvansloten opened this issue Nov 3, 2022 · 6 comments · Fixed by #18258
Closed
1 task done

azurerm_linux_function_app Storage options not working #19134

rdvansloten opened this issue Nov 3, 2022 · 6 comments · Fixed by #18258

Comments

@rdvansloten
Copy link

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

AzureRM Provider Version

3.29.1

Affected Resource(s)/Data Source(s)

azurerm_linux_function_app

Terraform Configuration Files

resource "azurerm_linux_function_app" "function_apps" {
  name                          = "myapp"
  resource_group_name           = azurerm_resource_group.main.name
  location                      = var.location
  storage_account_name          = azurerm_storage_account.function_app_storage.name
  storage_account_access_key    = azurerm_storage_account.function_app_storage.primary_access_key
  service_plan_id               = azurerm_service_plan.asp.id
  https_only                    = true

  identity {
    type         = "UserAssigned"
    identity_ids = [azurerm_user_assigned_identity.function_apps.id]
  }

  site_config {
    application_insights_connection_string = azurerm_application_insights.function_app.connection_string
    application_insights_key               = azurerm_application_insights.function_app.instrumentation_key

    application_stack {
      python_version = "3.9"
    }

    cors {
      allowed_origins = [
        "mydomain.com"
      ]
      support_credentials = true
    }
  }

  app_settings = {
    APP_PARTITION_KEY            = var.app_partition_key
    ENVIRONMENT                  = var.environment
    HOME_URL                     = var.home_url
  }
}


### Debug Output/Panic Output

```shell
-

Expected Behaviour

storage_account_name and storage_account_access_key are set, and the promised vars should have been generated. They have not.

From the docs:
"Note: For storage related settings, please use related properties that are available such as storage_account_access_key, terraform will assign the value to keys such as WEBSITE_CONTENTAZUREFILECONNECTIONSTRING, AzureWebJobsStorage in app_setting."

AzureWebJobsStorage vars are set, but WEBSITE_CONTENTAZUREFILECONNECTIONSTRING and WEBSITE_CONTENTSHARE are not.

When creating through the Portal, this all works. The docs are either wrong or incomplete, or the module is not doing what it should.

Actual Behaviour

The environment variables that were promised, are not generated. This causes deployments to fail, because there is no storage.
Screen Shot 2022-11-03 at 19 41 16

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@rdvansloten rdvansloten added the bug label Nov 3, 2022
@github-actions github-actions bot removed the bug label Nov 3, 2022
@xiaxyi
Copy link
Contributor

xiaxyi commented Nov 7, 2022

Thanks @rdvansloten for raising this issue, may I know the service plan? Is it standard plan or premium/ elastic?

This setting is only required for consumption/ premium plan
image

https://learn.microsoft.com/en-us/azure/azure-functions/functions-app-settings#website_contentazurefileconnectionstring

@rdvansloten
Copy link
Author

@xiaxyi I am using Consumption (Y) tier. Another thing is that if I deploy via Terraform and set these settings manually, I am unable to push Python code via VS Code. I have to create the Functions manually, then import. It seems that this env var needs to be set at create time, or the storage never gets linked.

@xiaxyi
Copy link
Contributor

xiaxyi commented Nov 7, 2022

@rdvansloten I will raise a pr for the fix, the current provider didn't sets this property for consumption plan.

@xiaxyi
Copy link
Contributor

xiaxyi commented Nov 9, 2022

@rdvansloten , you can track the status in the pr #18258

@github-actions
Copy link

This functionality has been released in v3.48.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

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