I provided the Azure Application Insights connection string as a Key Vault reference through the environment variable named APPLICATIONINSIGHTS_CONNECTION_STRING. The setup is able to connect to the Key Vault, as shown in the image below.
However, there is still one issue: although everything is being logged in the Application Insights log tab of the Azure Function, it continues to provide an option to configure Application Insights, even though it is already configured.
As a workaround after Terraform deployment, I have to provide the Application Insights connection string in plain text. After it shows it's connected with Application Insights, then again, I reference the Key Vault, and everything works as expected.
I provided the Azure Application Insights connection string as a Key Vault reference through the environment variable named
APPLICATIONINSIGHTS_CONNECTION_STRING. The setup is able to connect to the Key Vault, as shown in the image below.However, there is still one issue: although everything is being logged in the Application Insights log tab of the Azure Function, it continues to provide an option to configure Application Insights, even though it is already configured.
As a workaround after Terraform deployment, I have to provide the Application Insights connection string in plain text. After it shows it's connected with Application Insights, then again, I reference the Key Vault, and everything works as expected.