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 requires both connection string and instrumentation key for app insights #16077

Closed
brennfoster opened this issue Mar 25, 2022 · 5 comments · Fixed by #16134
Assignees
Milestone

Comments

@brennfoster
Copy link

Function Apps only require the instrumentation key to connect to Application Insights. There is no need to provide both a connection string and an instrumentation key.

│ Error: Missing required argument

│ with azurerm_linux_function_app
│ application_insights_key = var.app_insights_instrumentation_key

│ "site_config.0.application_insights_key": all of
site_config.0.application_insights_connection_string,site_config.0.application_insights_key
│ must be specified

@jschwellnus92
Copy link
Contributor

This exact same issue exists for azurerm_windows_function_app

@tiagoboeing
Copy link

tiagoboeing commented Apr 7, 2022

I fixed this passing connection_string too. The documentation doesn't show this as a required parameter (I know, is required only if Application Insights is being configured):

image

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_function_app

But! If you use Application Insights and pass application_insights_key (instrumentation_key) the application_insights_connection_string will be required!

Configs example:

resource "azurerm_linux_function_app" "function_app" {
  ...

  site_config {
    application_insights_key               = azurerm_application_insights.application_insights.instrumentation_key
    application_insights_connection_string = azurerm_application_insights.application_insights.connection_string
  }

  ...
}

Edit

  • I created a topic on Terraform forum to improve the documentation by adding a note about the dependency between these arguments.
  • As the PR was released, the improvement on the documentation isn't needed anymore. Topic deleted on Terraform forum.

@github-actions
Copy link

github-actions bot commented Apr 8, 2022

This functionality has been released in v3.1.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!

@kmadof
Copy link

kmadof commented Apr 20, 2022

I still have the same issue on hashicorp/azurerm v3.2.0...

@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 May 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.