Skip to content

Commit

Permalink
Merge branch 'main' into LNK-2159-Shared-Add-SQL-Persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
arianamihailescu authored Apr 1, 2024
2 parents d2df0a5 + 59033f9 commit 3f4b1b3
Show file tree
Hide file tree
Showing 176 changed files with 4,746 additions and 1,046 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/autocomment-on-pr-shared.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
run: |
# Use GitHub API to create a comment on the PR
PR_NUMBER=${{ github.event.pull_request.number }}
COMMENT="****THERE IS A NEW VERSIONING APPROACH TO VERSIONING OF THE SHARED PROJECT*****\nPlease refere here for guidance: https://lantana.atlassian.net/wiki/spaces/LSD/pages/493322243/Shared+NuGet+Project+Versioning+and+Releases"
COMMENT="****THERE IS A NEW APPROACH TO VERSIONING OF THE SHARED PROJECT*****\nPlease refer here for guidance: https://lantana.atlassian.net/wiki/spaces/LSD/pages/493322243/Shared+NuGet+Project+Versioning+and+Releases"
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
COMMENT_URL="https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"
curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST $COMMENT_URL -d "{\"body\":\"$COMMENT\"}"
curl -s -H "Authorization: token ${GITHUB_TOKEN}" -X POST $COMMENT_URL -d "{\"body\":\"$COMMENT\"}"
4 changes: 3 additions & 1 deletion Account/Account.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="8.*" />
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="com.lantanagroup.link.Shared" Version="2024.3.14.3" />
<PackageReference Include="Azure.Identity" Version="1.10.4" />
<PackageReference Include="com.lantanagroup.link.Shared" Version="2.*" />
<PackageReference Include="Confluent.Kafka" Version="2.*" />
<PackageReference Include="Confluent.Kafka.Extensions.OpenTelemetry" Version="0.*" />
<PackageReference Include="Grpc.AspNetCore" Version="2.*" />
<PackageReference Include="Grpc.AspNetCore.Server.Reflection" Version="2.*" />
<PackageReference Include="Microsoft.AspNetCore.Grpc.JsonTranscoding" Version="8.*" />
<PackageReference Include="Microsoft.AspNetCore.Grpc.Swagger" Version="0.*" />
<PackageReference Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="7.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.*" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.*" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.7.0" />
Expand Down
30 changes: 30 additions & 0 deletions Account/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Azure.Identity;
using Confluent.Kafka.Extensions.OpenTelemetry;
using HealthChecks.UI.Client;
using LantanaGroup.Link.Account.Domain.Entities;
Expand All @@ -8,6 +9,7 @@
using LantanaGroup.Link.Shared.Application.Models.Configs;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Http.Json;
using Microsoft.Extensions.Configuration.AzureAppConfiguration;
using OpenTelemetry.Metrics;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
Expand All @@ -32,6 +34,34 @@

static void RegisterServices(WebApplicationBuilder builder)
{
//load external configuration source if specified
var externalConfigurationSource = builder.Configuration.GetSection(AccountConstants.AppSettingsSectionNames.ExternalConfigurationSource).Get<string>();

if (!string.IsNullOrEmpty(externalConfigurationSource))
{
switch (externalConfigurationSource)
{
case ("AzureAppConfiguration"):
builder.Configuration.AddAzureAppConfiguration(options =>
{
options.Connect(builder.Configuration.GetConnectionString("AzureAppConfiguration"))
// Load configuration values with no label
.Select("*", LabelFilter.Null)
// Load configuration values for service name
.Select("*", AccountConstants.ServiceName)
// Load configuration values for service name and environment
.Select("*", AccountConstants.ServiceName + ":" + builder.Environment.EnvironmentName);

options.ConfigureKeyVault(kv =>
{
kv.SetCredential(new DefaultAzureCredential());
});

});
break;
}
}

var serviceInformation = builder.Configuration.GetRequiredSection(AccountConstants.AppSettingsSectionNames.ServiceInformation).Get<ServiceInformation>();
if (serviceInformation != null)
{
Expand Down
3 changes: 2 additions & 1 deletion Account/Settings/AccountConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public static class AccountConstants
{
public const string ServiceName = "Account Service";
public const string ServiceName = "Account";

public static class AppSettingsSectionNames
{
Expand All @@ -11,6 +11,7 @@ public static class AppSettingsSectionNames
public const string Postgres = "Postgres";
public const string Telemetry = "TelemetryConfig";
public const string TenantApiSettings = "TenantApiSettings";
public const string ExternalConfigurationSource = "ExternalConfigurationSource";
}
}
}
14 changes: 14 additions & 0 deletions Account/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@
"Microsoft.AspNetCore": "Warning"
}
},
"Kestrel": {
"Endpoints": {
"http": {
"Url": "http://localhost:7221"
},
"https": {
"Url": "https://localhost:7222"
},
"Grpc": {
"Url": "http://localhost:7223",
"Protocols": "Http2"
}
}
},
"TenantApiSettings": {
"TenantServiceBaseEndpoint": "https://localhost:7332/api/",
"CheckIfTenantExists": true,
Expand Down
14 changes: 0 additions & 14 deletions Account/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,6 @@
"TelemetryCollectorEndpoint": "http://localhost:4317"
},
"AllowedHosts": "*",
"Kestrel": {
"Endpoints": {
"http": {
"Url": "http://localhost:7221"
},
"https": {
"Url": "https://localhost:7222"
},
"Grpc": {
"Url": "http://localhost:7223",
"Protocols": "Http2"
}
}
},
"Serilog": {
"Using": [
"Serilog.Sinks.Grafana.Loki"
Expand Down
2 changes: 1 addition & 1 deletion Audit/Audit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.10.4" />
<PackageReference Include="com.lantanagroup.link.Shared" Version="2024.3.14.3" />
<PackageReference Include="com.lantanagroup.link.Shared" Version="2.*" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="8.0.0" />
<PackageReference Include="Confluent.Kafka.Extensions.OpenTelemetry" Version="0.3.0" />
<PackageReference Include="Grpc.AspNetCore" Version="2.61.0" />
Expand Down
7 changes: 6 additions & 1 deletion Azure_Pipelines/azure-pipelines.account.cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ variables:
value: 'AccountUnitTests/AccountUnitTests.csproj'
- name: nugetPath
value: 'Account/nuget.config'
- name: serviceName
value: 'Account'
- name: tags1
value: 'latest'
- name: tags2
Expand All @@ -26,6 +28,9 @@ variables:
value: 'link-account'
- name: dockerPath
value: '**/Account/Dockerfile'
- name: containerRegistry
value: 'NHSNLink ACR Premium'

steps:
- template: ../azure-nuget-package-source.yml
- task: DotNetCoreCLI@2
Expand Down Expand Up @@ -53,7 +58,7 @@ steps:
displayName: "Build & Push Account Docker Image"
condition: always()
inputs:
containerRegistry: 'Link ACR'
containerRegistry: $(containerRegistry)
repository: $(registry-repo-name)
command: 'buildAndPush'
Dockerfile: $(dockerPath)
Expand Down
4 changes: 3 additions & 1 deletion Azure_Pipelines/azure-pipelines.audit.cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ variables:
value: '**/Audit/Dockerfile'
- name: serviceName
value: 'Audit'
- name: containerRegistry
value: 'NHSNLink ACR Premium'

steps:
- template: ../azure-nuget-package-source.yml
Expand Down Expand Up @@ -57,7 +59,7 @@ steps:
displayName: "Build & Push Audit Docker Image"
condition: always()
inputs:
containerRegistry: 'Link ACR'
containerRegistry: $(containerRegistry)
repository: $(registry-repo-name)
command: 'buildAndPush'
Dockerfile: $(dockerPath)
Expand Down
4 changes: 3 additions & 1 deletion Azure_Pipelines/azure-pipelines.census.cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ variables:
value: '**/Census/Dockerfile'
- name: serviceName
value: 'Census'
- name: containerRegistry
value: 'NHSNLink ACR Premium'

steps:
- template: ../azure-nuget-package-source.yml
Expand Down Expand Up @@ -57,7 +59,7 @@ steps:
displayName: "Build & Push Census Docker Image"
condition: always()
inputs:
containerRegistry: 'Link ACR'
containerRegistry: $(containerRegistry)
repository: $(registry-repo-name)
command: 'buildAndPush'
Dockerfile: $(dockerPath)
Expand Down
4 changes: 3 additions & 1 deletion Azure_Pipelines/azure-pipelines.dataacquisition.cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ variables:
value: '**/DataAcquisition/Dockerfile'
- name: serviceName
value: 'DataAcquisition'
- name: containerRegistry
value: 'NHSNLink ACR Premium'

steps:
- template: ../azure-nuget-package-source.yml
Expand Down Expand Up @@ -57,7 +59,7 @@ steps:
displayName: "Build & Push DataAcquisition Docker Image"
condition: always()
inputs:
containerRegistry: 'Link ACR'
containerRegistry: $(containerRegistry)
repository: $(registry-repo-name)
command: 'buildAndPush'
Dockerfile: $(dockerPath)
Expand Down
3 changes: 2 additions & 1 deletion Azure_Pipelines/azure-pipelines.gateway.cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ variables:
$(Build.BuildId)
registry-repo-Name: 'link-api-gw'
dockerPath: '**/DemoApiGateway/Dockerfile'
containerRegistry: 'NHSNLink ACR Premium'

steps:
- task: PowerShell@2
Expand Down Expand Up @@ -73,7 +74,7 @@ steps:
displayName: "Build & Push DemoApiGateway Docker Image"
condition: always()
inputs:
containerRegistry: 'Link ACR'
containerRegistry: $(containerRegistry)
repository: $(registry-repo-name)
command: 'buildAndPush'
Dockerfile: $(dockerPath)
Expand Down
4 changes: 3 additions & 1 deletion Azure_Pipelines/azure-pipelines.measureeval.cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ variables:
value: '**/MeasureEval/Dockerfile'
- name: serviceName
value: 'MeasureEval'
- name: containerRegistry
value: 'NHSNLink ACR Premium'

steps:
- template: ../azure-nuget-package-source.yml
Expand Down Expand Up @@ -57,7 +59,7 @@ steps:
displayName: "Build & Push MeasureEval Docker Image"
condition: always()
inputs:
containerRegistry: 'Link ACR'
containerRegistry: $(containerRegistry)
repository: $(registry-repo-name)
command: 'buildAndPush'
Dockerfile: $(dockerPath)
Expand Down
4 changes: 3 additions & 1 deletion Azure_Pipelines/azure-pipelines.normalization.cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ variables:
value: '**/Normalization/Dockerfile'
- name: serviceName
value: 'Normalization'
- name: containerRegistry
value: 'NHSNLink ACR Premium'

steps:
- template: ../azure-nuget-package-source.yml
Expand Down Expand Up @@ -57,7 +59,7 @@ steps:
displayName: "Build & Push Normalization Docker Image"
condition: always()
inputs:
containerRegistry: 'Link ACR'
containerRegistry: $(containerRegistry)
repository: $(registry-repo-name)
command: 'buildAndPush'
Dockerfile: $(dockerPath)
Expand Down
4 changes: 3 additions & 1 deletion Azure_Pipelines/azure-pipelines.notification.cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ variables:
value: '**/Notification/Dockerfile'
- name: serviceName
value: 'Notification'
- name: containerRegistry
value: 'NHSNLink ACR Premium'

steps:
- template: ../azure-nuget-package-source.yml
Expand Down Expand Up @@ -57,7 +59,7 @@ steps:
displayName: "Build & Push Notification Docker Image"
condition: always()
inputs:
containerRegistry: 'Link ACR'
containerRegistry: $(containerRegistry)
repository: $(registry-repo-name)
command: 'buildAndPush'
Dockerfile: $(dockerPath)
Expand Down
72 changes: 0 additions & 72 deletions Azure_Pipelines/azure-pipelines.patientbundlepermeasure.cd.yaml

This file was deleted.

Loading

0 comments on commit 3f4b1b3

Please sign in to comment.