***UPDATE JUNE 29, 2021***
I’d like to point out this guide is nearly 3 years old, and I have not revisited any of the material in some time. Search engine hits keep bringing people to this page, so I wanted to point out:
Please be aware Azure likes to update/retire APIs on a regular basis… some or all of this information may be out-of-date.
Then I get a few weeks into my internship, and there’s this new idea: a webjob. Essentially, a console app that runs on the cloud for background tasks. They’re awesome…until they start doing weird things while deployed. Azure gives you a couple hundred lines of debug console for free, but that’s just not a sustainable solution. This was the point my boss said some vague words about “App Insights” and pointed at an example the other developer had worked out a while back (modified from a guide neither of us were able to locate).
It took me quite a while to figure out how to even configure Application Insights in the webjob, and even longer to really zero in on how to use it intelligently. So I wanted to combine some of that hard-earned knowledge in a very long walk thru. We put together a toy app inside the webjob template, and configure it to run and send telemetry to an Application Insights resource.
The final code from this project is in a repo you’re more than welcome to.