I' writing an Azure webJob which is ultimately a console app before it is deployed. I'm trying to add Application Insights to this so I can have Telemetry Results. However since this is not a Web app of any sort Telemetry isnt a recognised part of the project.
When I atempt to add telemetry manually and set any details of the TelemetryConfiguration.Active frame work I am presented with the following error:
TelemetryConfiguration.Active.InstrumentationKey = settingsKey;
Exception:
'Microsoft.WindowsAzure.Storage.StorageException' in Microsoft.WindowsAzure.Storage.dll
Additional information: The remote server returned an error: (404) Not Found.
However if I run an ODATA mvc app in the solution all telemetry works fine 'out of the box'.
Any direction of how to set up Insights via the SDK would be very usful as I'm struggling to find and good documentaion for non web app examples.
The host code its self is based on the standard examples of web jobs:
JobHost host = new JobHost();
host.Start();
var task = host.CallAsync(typeof(Functions).GetMethod("MessageHandlingLoop"));
task.Wait();
host.Stop();
Telemetry Code then in the MessageHandlingLoop()
Thanks in advance!