private async Task FunctionTemplate(string functionName, Func <Task> process) { _loggerHelper.ResetCorrelationContextAndCorrelationId(Guid.NewGuid().ToString()); _logger.Event(_jobsConfiguration.LogEventId).With.Message($"\"{functionName}\" job started at: {DateTimeOffset.UtcNow}").AsInformation(); try { await process(); } catch (Exception exception) { _logger.Event(_jobsConfiguration.LogEventId).With.Exception(exception).Message($"Exception occured while running \"{functionName}\" job.").AsError(); } finally { _logger.Event(_jobsConfiguration.LogEventId).With.Message($"\"{functionName}\" job completed at: {DateTimeOffset.UtcNow}").AsInformation(); } }