Can anybody please suggest me how i can achieve adding correlation id for traceability of every http request to below function.
[FunctionName("GetCars")]
public async Task<IActionResult> GetCars([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "api/v1/id/{id}")] HttpRequest req, Guid id)
{
try
{
if (id == Guid.Empty)
{
_logger.LogError("Id is Empty");
}
var cars= _deviceService.GetCars(id);
return new OkObjectResult(cars);
}
catch (Exception ex)
{
_logger.LogError(ex, "Failed to Fetch Cars");
}
}