Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
61628b6
Filter health alerts from logging
hardik-desai-nhs Apr 20, 2026
975758f
Merge branch 'main' into DTOSS-12664-Filter-health-alerts-from-logging
hardik-desai-nhs Apr 20, 2026
aa19248
Merge branch 'main' into DTOSS-12664-Filter-health-alerts-from-logging
hardik-desai-nhs Apr 22, 2026
265c2ac
Merge branch 'main' into DTOSS-12664-Filter-health-alerts-from-logging
hardik-desai-nhs Apr 22, 2026
9c64c0a
fixes to health logs
hardik-desai-nhs Apr 22, 2026
4f7df1e
Ingestion-time transformation in workspace/App Insights
hardik-desai-nhs Apr 23, 2026
3514370
Merge branch 'main' into DTOSS-12664-Filter-health-alerts-from-logging
hardik-desai-nhs Apr 23, 2026
60f027f
enable for devtest
hardik-desai-nhs Apr 23, 2026
99197ab
try again
hardik-desai-nhs Apr 23, 2026
04c4806
use azapi for creating data collection rule
hardik-desai-nhs Apr 23, 2026
5841f91
try and fix tf issue
hardik-desai-nhs Apr 23, 2026
742aecb
fix type
hardik-desai-nhs Apr 23, 2026
277c672
add missing workspace link
hardik-desai-nhs Apr 23, 2026
155bbe9
code clean up
hardik-desai-nhs Apr 23, 2026
ab6730d
set app_requests_transform_enabled to true by default
hardik-desai-nhs Apr 23, 2026
4611db8
removed duplicate comment
hardik-desai-nhs Apr 23, 2026
6c2f2ff
use azurerm
hardik-desai-nhs Apr 24, 2026
4e8745f
Revert "use azurerm"
hardik-desai-nhs Apr 24, 2026
3b472c4
realign DeleteParticipant function to other function apps
hardik-desai-nhs Apr 27, 2026
609374d
Merge branch 'main' into DTOSS-12664-Filter-health-alerts-from-logging
hardik-desai-nhs Apr 27, 2026
5b0c45e
fix for missing dependency in DeleteParticipant
hardik-desai-nhs Apr 27, 2026
4e5f42f
fix audit writer function app startup issue
hardik-desai-nhs Apr 27, 2026
d729d92
standardized Service Bus connection naming across the solution
hardik-desai-nhs Apr 27, 2026
a7b3419
Merge branch 'main' into DTOSS-12664-Filter-health-alerts-from-logging
hardik-desai-nhs Apr 27, 2026
ba5ed16
fix the connection string name for trigger
hardik-desai-nhs Apr 27, 2026
20d0c3d
add missing config in the conpose yamls
hardik-desai-nhs Apr 27, 2026
95a4685
code clean up
hardik-desai-nhs Apr 28, 2026
c548d67
fix DevTest deployment issue due to PR_NUM invalid json error
hardik-desai-nhs Apr 28, 2026
a91f91b
added missing health check endpoint in AuditWriter
hardik-desai-nhs Apr 28, 2026
900e2e0
just do basic health check we dont need DB health check
hardik-desai-nhs Apr 28, 2026
37563f3
Merge branch 'main' into DTOSS-12664-Filter-health-alerts-from-logging
hardik-desai-nhs Apr 28, 2026
0380edc
code review fixes
hardik-desai-nhs May 1, 2026
4852803
Merge branch 'main' into DTOSS-12664-Filter-health-alerts-from-logging
hardik-desai-nhs May 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions .github/workflows/stage-3-build-images-devtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,14 @@ jobs:
run: |

echo "The branch is: ${GITHUB_REF}"
PR_NUM=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/pulls --jq '.[0].number')
PR_NUM_TAG="pr${PR_NUM}"
PR_NUM=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/pulls --jq '.[0].number' 2>/dev/null || true)
if [ -n "${PR_NUM}" ] && [ "${PR_NUM}" != "null" ]; then
PR_NUM_TAG="pr${PR_NUM}"
echo "Tag source: PR (${PR_NUM})"
else
PR_NUM_TAG="${GITHUB_REF_NAME//\//-}"
echo "Tag source: fallback ref (${GITHUB_REF_NAME})"
fi
SHORT_COMMIT_HASH=$(git rev-parse --short ${GITHUB_SHA})


Expand Down Expand Up @@ -149,8 +155,14 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |

PR_NUM=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/pulls --jq '.[0].number')
PR_NUM_TAG="pr${PR_NUM}"
PR_NUM=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/pulls --jq '.[0].number' 2>/dev/null || true)
if [ -n "${PR_NUM}" ] && [ "${PR_NUM}" != "null" ]; then
PR_NUM_TAG="pr${PR_NUM}"
echo "Tag source: PR (${PR_NUM})"
else
PR_NUM_TAG="${GITHUB_REF_NAME//\//-}"
echo "Tag source: fallback ref (${GITHUB_REF_NAME})"
fi
IMAGE_TAG="latest"

if [[ ${{steps.detect-base-image-changes.outputs.BASE_IMAGE_CHANGE}} == 'true' ]]; then
Expand Down Expand Up @@ -213,8 +225,14 @@ jobs:
ENVIRONMENT_TAG: ${{ inputs.environment_tag }}
continue-on-error: false
run: |
PR_NUM=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/pulls --jq '.[0].number')
PR_NUM_TAG="pr${PR_NUM}"
PR_NUM=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/pulls --jq '.[0].number' 2>/dev/null || true)
if [ -n "${PR_NUM}" ] && [ "${PR_NUM}" != "null" ]; then
PR_NUM_TAG="pr${PR_NUM}"
echo "Tag source: PR (${PR_NUM})"
else
PR_NUM_TAG="${GITHUB_REF_NAME//\//-}"
echo "Tag source: fallback ref (${GITHUB_REF_NAME})"
fi
DEVTEST_PR_NUM_TAG="devtest_${PR_NUM_TAG}"

echo "The branch is: ${GITHUB_REF}"
Expand Down
1 change: 1 addition & 0 deletions application/CohortManager/compose.cohort-distribution.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
BASE_IMAGE: ${FUNCTION_BASE_IMAGE}
environment:
- ServiceBusConnectionString_internal=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
- ServiceBusConnectionString_client_internal=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
- CohortDistributionTopic=cohort-distribution-topic
- DistributeParticipantSubscription=distribute-participant-sub
- AzureWebJobsStorage=${AZURITE_CONNECTION_STRING}
Expand Down
10 changes: 9 additions & 1 deletion application/CohortManager/compose.core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ services:
- ManageNemsSubscriptionUnsubscribeURL=http://manage-nems-subscription:9081/api/Unsubscribe
- ManageNemsSubscriptionSubscribeURL=http://manage-nems-subscription:9081/api/Subscribe
- DemographicDataServiceURL=http://participant-demographic-data-service:7993/api/ParticipantDemographicDataService
- ServiceBusConnectionString_internal=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
- ServiceBusConnectionString_client_internal=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
- ParticipantManagementTopic=participant-management-topic

Expand Down Expand Up @@ -94,6 +95,7 @@ services:
- batchDivisionFactor=5
- ScreeningLkpDataServiceURL=http://screening-lkp-data-service:8996/api/ScreeningLkpDataService
- inboundBlobName=inbound
- ServiceBusConnectionString_internal=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
- ServiceBusConnectionString_client_internal=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
- fileExceptions=file-exceptions
- ParticipantManagementTopic=participant-management-topic
Expand Down Expand Up @@ -194,6 +196,7 @@ services:
BASE_IMAGE: ${FUNCTION_BASE_IMAGE}
profiles: [ui]
environment:
- ServiceBusConnectionString_internal=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
- ServiceBusConnectionString_client_internal=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
- ServiceNowParticipantManagementTopic=servicenow-participant-management-topic
- RetrievePdsDemographicURL=http://retrieve-pds-demographic:8082/api/RetrievePDSDemographic
Expand All @@ -210,7 +213,8 @@ services:
environment:
- AzureWebJobsStorage=${AZURITE_CONNECTION_STRING}
- DtOsDatabaseConnectionString=Server=db,1433;Database=${DB_NAME};User Id=SA;Password=${PASSWORD};TrustServerCertificate=True
- ServiceBusConnectionString=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
- ServiceBusConnectionString_internal=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
- ServiceBusConnectionString_client_internal=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
- AuditTopicName=participant-audit-topic
- AuditSubscription=audit-writer-sub

Expand All @@ -231,6 +235,8 @@ services:
- DemographicDataServiceURL=http://participant-demographic-data-service:7993/api/ParticipantDemographicDataService/
- ExceptionManagementDataServiceURL=http://exception-management-data-service:7911/api/ExceptionManagementDataService/
- GPPracticeDataServiceURL=http://localhost:7999/api/GPPracticeDataService/
- ServiceBusConnectionString_internal=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
- ServiceBusConnectionString_client_internal=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;

update-exception:
container_name: update-exception
Expand Down Expand Up @@ -326,6 +332,7 @@ services:
- AuthTokenURL=https://int.api.service.nhs.uk/oauth2/token
- LocalPrivateKeyFileName=RetrievePdsDemographic-DEV1.pem.key
- ParticipantManagementTopic=participant-management-topic
- ServiceBusConnectionString_internal=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
- ServiceBusConnectionString_client_internal=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
- ClientId=Get-private-key-from-NHS-dev-portal
- UseFakePDSServices=true
Expand Down Expand Up @@ -430,6 +437,7 @@ services:
- ServiceNowClientSecret=MockClientSecret-123
- ServiceNowRefreshToken=MockRefreshToken-123
- ServiceNowParticipantManagementTopic=servicenow-participant-management-topic
- ServiceBusConnectionString_internal=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
- ServiceBusConnectionString_client_internal=Endpoint=sb://service-bus;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;
ports:
- 9092:9092
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace NHS.CohortManager.AuditServices;
public class AuditConfig
{
[Required]
public required string ServiceBusConnectionString { get; set; }
public required string ServiceBusConnectionString_client_internal { get; set; }
[Required]
public required string AzureWebJobsStorage { get; set; }
[Required]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public AuditWriter(DataServicesContext dbContext, ILogger<AuditWriter> logger)

[Function(nameof(AuditWriter))]
public async Task Run(
[ServiceBusTrigger(topicName: "%AuditTopicName%", subscriptionName: "%AuditSubscription%", Connection = "ServiceBusConnectionString")] string messageText, FunctionContext context)
[ServiceBusTrigger(topicName: "%AuditTopicName%", subscriptionName: "%AuditSubscription%", Connection = "ServiceBusConnectionString_internal")] string messageText, FunctionContext context)
{
ParticipantAuditMessage? audit;
try
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using DataServices.Core;
using DataServices.Database;
using HealthChecks.Extensions;
using Common;
using NHS.CohortManager.AuditServices;

var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults()
.AddConfiguration<AuditConfig>(out AuditConfig auditConfig)
.AddDataServicesHandler<DataServicesContext>()
.AddServiceBusClient(auditConfig.ServiceBusConnectionString)
.AddServiceBusClient(auditConfig.ServiceBusConnectionString_client_internal)
.ConfigureServices(services =>
{
services.AddDatabaseHealthCheck("AuditWriter");
services.AddBasicHealthCheck("AuditWriter");
})
.AddTelemetry()
.Build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
},
"logLevel": {
"HealthChecks": "Error",
"HealthChecks.Extensions": "Error"
"HealthChecks.Extensions": "Error",
"Function.health": "Error"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"logLevel": {
"HealthChecks": "Error",
"HealthChecks.Extensions": "Error"
"HealthChecks.Extensions": "Error",
"Function.health": "Error"
}
},
"concurrency": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
"isEnabled": true,
"excludedTypes": "Request"
},
"enableLiveMetricsFilters": true,
"logLevel": {
"HealthChecks": "Error",
"HealthChecks.Extensions": "Error"
}
"enableLiveMetricsFilters": true
},
"logLevel": {
"HealthChecks": "Error",
"HealthChecks.Extensions": "Error",
"Function.health": "Error"
}
},
"concurrency": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"logLevel": {
"HealthChecks": "Error",
"HealthChecks.Extensions": "Error"
"HealthChecks.Extensions": "Error",
"Function.health": "Error"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"logLevel": {
"HealthChecks": "Error",
"HealthChecks.Extensions": "Error"
"HealthChecks.Extensions": "Error",
"Function.health": "Error"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"logLevel": {
"HealthChecks": "Error",
"HealthChecks.Extensions": "Error"
"HealthChecks.Extensions": "Error",
"Function.health": "Error"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NHS.CohortManager.DemographicServices;

using System.Net;
using System.Threading.Tasks;
using HealthChecks.Extensions;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
using Microsoft.Extensions.Diagnostics.HealthChecks;
Expand All @@ -18,15 +18,6 @@ public HealthCheckFunction(HealthCheckService healthCheckService)
[Function("health")]
public async Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequestData req)
{
var healthReport = await _healthCheckService.CheckHealthAsync();

var response = req.CreateResponse(healthReport.Status == HealthStatus.Healthy ? HttpStatusCode.OK : HttpStatusCode.ServiceUnavailable);
await response.WriteAsJsonAsync(new
{
status = healthReport.Status.ToString(),
details = healthReport.Entries
});

return response;
return await HealthCheckServiceExtensions.CreateHealthCheckResponseAsync(req, _healthCheckService);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
},
"logLevel": {
"HealthChecks": "Error",
"HealthChecks.Extensions": "Error"
"HealthChecks.Extensions": "Error",
"Function.health": "Error"
}
},
"extensions": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "2.0",
"functionTimeout": "01:00:00",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
},
"enableLiveMetricsFilters": true
},
"logLevel": {
"HealthChecks": "Error",
"HealthChecks.Extensions": "Error",
"Function.health": "Error"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"logLevel": {
"HealthChecks": "Error",
"HealthChecks.Extensions": "Error"
"HealthChecks.Extensions": "Error",
"Function.health": "Error"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NHS.CohortManager.DemographicServices;

using System.Net;
using System.Threading.Tasks;
using HealthChecks.Extensions;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
using Microsoft.Extensions.Diagnostics.HealthChecks;
Expand All @@ -18,15 +18,6 @@ public HealthCheckFunction(HealthCheckService healthCheckService)
[Function("health")]
public async Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequestData req)
{
var healthReport = await _healthCheckService.CheckHealthAsync();

var response = req.CreateResponse(healthReport.Status == HealthStatus.Healthy ? HttpStatusCode.OK : HttpStatusCode.ServiceUnavailable);
await response.WriteAsJsonAsync(new
{
status = healthReport.Status.ToString(),
details = healthReport.Entries
});

return response;
return await HealthCheckServiceExtensions.CreateHealthCheckResponseAsync(req, _healthCheckService);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"logLevel": {
"HealthChecks": "Error",
"HealthChecks.Extensions": "Error"
"HealthChecks.Extensions": "Error",
"Function.health": "Error"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public async Task<HttpResponseData> RunAsync([HttpTrigger(AuthorizationLevel.Ano

[Function("RunCreateException")]
public async Task Run(
[ServiceBusTrigger(topicName: "%CreateExceptionTopic%", subscriptionName: "%ExceptionSubscription%", Connection = "ServiceBusConnectionString", AutoCompleteMessages = false)]
[ServiceBusTrigger(topicName: "%CreateExceptionTopic%", subscriptionName: "%ExceptionSubscription%", Connection = "ServiceBusConnectionString_internal", AutoCompleteMessages = false)]
ServiceBusReceivedMessage message,
ServiceBusMessageActions messageActions)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ public class CreateExceptionConfig
public required string ExceptionManagementDataServiceURL {get; set;}
[Required]
public required string DemographicDataServiceURL {get; set;}
[Required]
public required string ServiceBusConnectionString_client_internal { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace NHS.CohortManager.ExceptionService;

using System.Net;
using System.Threading.Tasks;
using HealthChecks.Extensions;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
using Microsoft.Extensions.Diagnostics.HealthChecks;
Expand All @@ -18,15 +18,6 @@ public HealthCheckFunction(HealthCheckService healthCheckService)
[Function("health")]
public async Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequestData req)
{
var healthReport = await _healthCheckService.CheckHealthAsync();

var response = req.CreateResponse(healthReport.Status == HealthStatus.Healthy ? HttpStatusCode.OK : HttpStatusCode.ServiceUnavailable);
await response.WriteAsJsonAsync(new
{
status = healthReport.Status.ToString(),
details = healthReport.Entries
});

return response;
return await HealthCheckServiceExtensions.CreateHealthCheckResponseAsync(req, _healthCheckService);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
.AddDataService<ExceptionManagement>(config.ExceptionManagementDataServiceURL)
.AddDataService<ParticipantDemographic>(config.DemographicDataServiceURL)
.Build()
.AddServiceBusClient(config.ServiceBusConnectionString_client_internal)
.ConfigureFunctionsWebApplication()
.ConfigureServices(services =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"logLevel": {
"HealthChecks": "Error",
"HealthChecks.Extensions": "Error"
"HealthChecks.Extensions": "Error",
"Function.health": "Error"
}
}
}
Loading
Loading