Use the template found in the following link:

https://github.com/rcw3bb/azure-application-insight-custom-telemetry