-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Function App log invocation with App Insights #2457
Comments
hey @kamran-pervaiz Thanks for opening this issue :) Unfortunately at this time the only means of linking an Application Insights resource to an App Service / Function App is via this (kinda hidden) tag linking the two resources. I've previously raised a request with Microsoft (through some internal channels) to be able to add an API Endpoint to be able to configure this independent of the two resources (since, it should be possible to configure both independently and then link the two, imo). I've not seen anything come of this yet - but if you're interested in this behaviour I'd recommend opening a bug on the Azure REST API Specs Repository repository requesting support for this. From Terraform's perspective since App Services and Function Apps share the same underlying API (at this point in time at least) - I'm going to close this in favour of #1303 which is tracking a request for a resource linking Application Gateway's and App Services Thanks! |
@tombuildsstuff thank you for quick reply, I tried hidden link but its not substituting the values, any idea how to do it?
Terraform output is: azurerm_application_insights.application_insights: Creating...
|
@kamran-pervaiz it's hard to say without seeing more of the configuration being used, would you be able to post the rest of the configuration / confirm which outputs are available from the module? |
thanks @tombuildsstuff for quick reply, below is my outputs.tf for resource-group.
function-app outputs.tf
|
@kamran-pervaiz the configuration looks valid - as such it could be that it's not possible to interpolate key values in Terraform 0.11; such that a virtual resource may be necessary in the interim here 🤔 |
@tombuildsstuff thank you for your reply, I managed to make hidden-link by using
function but for some reason it doesn't configure app insights for function app. There might be some other bits which needs configuring but when I click Configure (with hidden-link) it takes me to a graph like appinsights is attached. another difference i found is that Configured features under function app doesn't list AppInsights with hidden-link compared to manually. according to this link we just need to add only instrumation key: https://docs.microsoft.com/en-us/azure/azure-functions/functions-monitoring#new-function-app Any suggestion is welcome. |
@tombuildsstuff found the problem. AppInsights_InstrumentationKey should be APPINSIGHTS_INSTRUMENTATIONKEY <-- casing matters
|
@kamran-pervaiz Can you please share how you generated the |
Actually it's OK - I figured it out: |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Terraform Version
Affected Resource(s)
Terraform Configuration File(s)
Expected Behavior
Actual Behavior
Difference
I have noticed the instrumentation key is indeed in app_settings but slot settings checkbox is not checked when I deploy using above terraform script but when I manually configure App Insights this checkbox is checked (below).
Other thing I found in the automation script generated by azure is, it has hidden link in tags of app_insights compared to what is generated by terraform (empty tags):
any suggestion?
The text was updated successfully, but these errors were encountered: