We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents dbefb9c + 121dcf9 commit 5c8bcc6Copy full SHA for 5c8bcc6
articles/azure-monitor/app/worker-service.md
@@ -204,9 +204,9 @@ Following is the code for `TimedHostedService` where the background task logic r
204
{
205
_logger.LogWarning("A sample warning message. By default, logs with severity Warning or higher is captured by Application Insights");
206
_logger.LogInformation("Calling bing.com");
207
- var res = await httpClient.GetAsync("https://bing.com");
+ var res = httpClient.GetAsync("https://bing.com").GetAwaiter().GetResult();
208
_logger.LogInformation("Calling bing completed with status:" + res.StatusCode);
209
- telemetryClient.TrackEvent("Bing call event completed");
+ _telemetryClient.TrackEvent("Bing call event completed");
210
}
211
212
0 commit comments