File tree Expand file tree Collapse file tree
application/CohortManager/src/Functions/AuditServices/AuditWriter Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 </PropertyGroup >
1010 <ItemGroup >
1111 <PackageReference Include =" Microsoft.Azure.Functions.Worker" />
12+ <PackageReference Include =" Microsoft.Azure.Functions.Worker.Extensions.Http" />
1213 <PackageReference Include =" Microsoft.Azure.Functions.Worker.Extensions.ServiceBus" />
1314 <PackageReference Include =" Microsoft.Azure.Functions.Worker.Sdk" />
1415 <PackageReference Include =" Microsoft.Extensions.Diagnostics.HealthChecks" />
Original file line number Diff line number Diff line change 1+ namespace NHS . CohortManager . AuditServices ;
2+
3+ using System . Threading . Tasks ;
4+ using HealthChecks . Extensions ;
5+ using Microsoft . Azure . Functions . Worker ;
6+ using Microsoft . Azure . Functions . Worker . Http ;
7+ using Microsoft . Extensions . Diagnostics . HealthChecks ;
8+
9+ public class HealthCheckFunction
10+ {
11+ private readonly HealthCheckService _healthCheckService ;
12+
13+ public HealthCheckFunction ( HealthCheckService healthCheckService )
14+ {
15+ _healthCheckService = healthCheckService ;
16+ }
17+
18+ [ Function ( "health" ) ]
19+ public async Task < HttpResponseData > Run ( [ HttpTrigger ( AuthorizationLevel . Anonymous , "get" ) ] HttpRequestData req )
20+ {
21+ return await HealthCheckServiceExtensions . CreateHealthCheckResponseAsync ( req , _healthCheckService ) ;
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments