I successfully deployed an app service plan, web application and application insights resources using an ARM Template. The APPINSIGHTS_INSTRUMENTATIONKEY and APPLICATIONINSIGHTS_CONNECTION_STRING app settings have been added to the configuration/app settings.
The issue im noticing is that when I select the 'application insights' option in the menu I'm presented with 'Turn on Application Insights'. I thought adding the app settings above would turn on app insights but apparently not. Is it possible to enable app insights in an ARM Template? I'd like app insights to be enabled by default once the arm template deploys.
I resolved this issue by adding the additional application settings to my ARM template:
ApplicationInsightsAgent_EXTENSION_VERSION: "~2" and XDT_MicrosoftApplicationInsights_Mode: "default"
Once added application insights was turned on.
With these configuration settings in ARM Template, It can be done