Configuring .NET Services

Configuring .NET services in the Link platform

Swagger

PropertyDescriptionRequiredDefault ValueSecret?
EnableSwaggerEnable Swagger spec and UINofalseNo

Azure App Config Environment Variables

The following should be specified as environment variables when launching the service:

NameDescriptionRequiredDefault ValueSecret?
ExternalConfigurationSourceSpecifies the configuration source to useYesNoneNo
ConnectionStrings__AzureAppConfigurationConnection string for Azure App ConfigurationYes (if using Azure)NoneYes

Blob Storage

NameDescriptionRequiredDefault ValueSecret?
InternalBlobStorage__ConnectionStringConnection string for internal ABSYes (if using ABS)NoneYes
InternalBlobStorage__BlobContainerNameBlob container name for internal ABSYes (if using ABS)NoneNo
InternalBlobStorage__BlobRootBlob root (name prefix) for internal ABSNoNoneNo
ExternalBlobStorage__ConnectionStringConnection string for external ABSNoNoneYes
ExternalBlobStorage__BlobContainerNameBlob container name for external ABSYes (if using ABS)NoneNo
ExternalBlobStorage__BlobRootBlob root (name prefix) for external ABSYes (if using ABS)NoneNo

Kafka

NameDescriptionRequiredDefault ValueSecret?
KafkaConnection__BootstrapServers__0Kafka broker addressYesNoneNo
KafkaConnection__GroupIdConsumer group identifierYesNoneNo
KafkaConnection__ClientIdUnique client identifierYesNoneNo
KafkaConnection__SaslProtocolEnabledWhether to enable SASL authNofalseNo
KafkaConnection__MechanismSASL mechanismNoPlainNo
KafkaConnection__ProtocolSASL protocolNoSaslPlaintextNo

Note: Mechanism and Protocol are only used when SASL authentication is enabled.

Options for Mechanism:

  • Plain
  • Gssapi
  • ScramSHA256
  • ScramSHA512
  • OAuthBearer

Options for Protocol:

  • SaslPlaintext
  • Plaintext
  • Ssl
  • SaslSsl

SASL Plain Text Authentication

Include the following configuration properties to connecto to Kafka that requires SASL_PLAINTEXT authentication:

NameValueSecret?
KafkaConnection__SaslProtocolEnabledtrueNo
KafkaConnection__SaslUsername<username>No
KafkaConnection__SaslPassword<password>Yes

Kafka Consumer Settings

NameDescriptionSecret?
ConsumerSettings__ConsumerRetryDurationA list of strings representing retry duration intervals for consumersNo
ConsumerSettings__DisableRetryConsumerA boolean flag to enable/disable the retry mechanism for consumersNo
ConsumerSettings__DisableConsumerA boolean flag to completely enable/disable the consumerNo

CORS

PropertyDescriptionRequiredDefaultSecret?
CORS__AllowAllOriginsAllow all originsNofalseNo
CORS__AllowedOriginsArray of allowed originsNo[]No
CORS__AllowAllMethodsAllow all HTTP methodsNotrueNo
CORS__AllowedMethodsArray of allowed HTTP methodsNo[“GET”, “POST”, “PUT”, “DELETE”, “OPTIONS”]No
CORS__AllowAllHeadersAllow all headersNotrueNo
CORS__MaxAgePreflight cache duration (seconds)No600No

Token Service Settings

TODO: Describe what the purpose of the token endpoint is

PropertyTypeDescriptionDefault ValueSecret?
LinkTokenService__EnableTokenGenerationEndpointboolControls whether the token generation endpoint is enabledfalseNo
LinkTokenService__AuthoritystringThe authority URL used for token validation/generationRequired (no default)No
LinkTokenService__LinkAdminEmailstring?Email address for Link administrationnullNo
LinkTokenService__TokenLifespanintThe lifespan of generated tokens in minutes10No
LinkTokenService__SigningKeystring?The key used for signing tokensnullYes
LinkTokenService__LogTokenboolControls whether token logging is enabledfalseNo

Service Authentication

PropertyDescriptionRequiredDefault ValueSecret?
Authentication__EnableAnonymousAccessEnable anonymous access to the serviceNofalseNo
Authentication__Schemas__LinkBearer__AuthorityAuthority URL for Link Bearer authenticationYesNoneNo
Authentication__Schemas__LinkBearer__ValidateTokenValidate the token on each requestNotrueNo
DataProtection__EnabledEnable data protection for sensitive dataNofalseNo

Redis

NameDescriptionRequiredSecret?
ConnectionStrings__RedisRedis connection stringYes (if caching enabled)Yes
Redis__PasswordRedis PasswordYes (if caching enabled)Yes
Cache__EnabledToggle for Redis cachingNoNo

Telemetry

NameDescriptionRequiredSecret?
Telemetry__EnableTelemetryEnable TelemetryYes (bool)No
Telemetry__EnableTracingEnable tracingYes (bool)No
Telemetry__EnableOtelCollectorEnable Otel collectorYes (bool)No
Telemetry__OtelCollectorEndpointOtel collector endpointYes (uri)No

Service Registry

The Service Registry section contains URLs and configurations for all microservices in the Link Cloud ecosystem. Configuration key: ServiceRegistry

Not all services use every URL. The configuration is provided for completeness and future-proofing. If using Azure App Configuration, all service URLs should be specified, and each service will use only the URLs it needs.

Service URLs

PropertyRequiredDescription
ServiceRegistry__AccountServiceUrlYesBase URL for the Account service
ServiceRegistry__PublicAccountServiceUrlNoPublic base URL for the Account service
ServiceRegistry__AuditServiceUrlYesBase URL for the Audit service
ServiceRegistry__PublicAuditServiceUrlNoPublic base URL for the Audit service
ServiceRegistry__CensusServiceUrlYesBase URL for the Census service
ServiceRegistry__PublicCensusServiceUrlNoPublic base URL for the Census service
ServiceRegistry__DataAcquisitionServiceUrlYesBase URL for the Data Acquisition service
ServiceRegistry__PublicDataAcquisitionServiceUrlNoPublic base URL for the Data Acquisition service
ServiceRegistry__MeasureServiceUrlYesBase URL for the Measure service
ServiceRegistry__PublicMeasureServiceUrlNoPublic base URL for the Measure service
ServiceRegistry__NormalizationServiceUrlYesBase URL for the Normalization service
ServiceRegistry__PublicNormalizationServiceUrlNoPublic base URL for the Normalization service
ServiceRegistry__NotificationServiceUrlYesBase URL for the Notification service
ServiceRegistry__PublicNotificationServiceUrlNoPublic base URL for the Notification service
ServiceRegistry__QueryDispatchServiceUrlYesBase URL for the Query Dispatch service
ServiceRegistry__PublicQueryDispatchServiceUrlNoPublic base URL for the Query Dispatch service
ServiceRegistry__ReportServiceUrlYesBase URL for the Report service
ServiceRegistry__PublicReportServiceUrlNoPublic base URL for the Report service
ServiceRegistry__SubmissionServiceUrlYesBase URL for the Submission service
ServiceRegistry__PublicSubmissionServiceUrlNoPublic base URL for the Submission service
ServiceRegistry__ValidationServiceUrlYesBase URL for the Validation service
ServiceRegistry__PublicValidationServiceUrlNoPublic base URL for the Validation service
ServiceRegistry__TerminologyServiceUrlYesBase URL for the Terminology service
ServiceRegistry__PublicTerminologyServiceUrlNoPublic base URL for the Terminology service
ServiceRegistry__TenantService__TenantServiceUrlYesBase URL for the Tenant service
ServiceRegistry__TenantService__PublicTenantServiceUrlNoPublic base URL for the Tenant service
ServiceRegistry__TenantService__CheckIfTenantExistsNoWhether to validate tenant’s existence in other services such as Data Acquisition
ServiceRegistry__TenantService__GetTenantRelativeEndpointNoRelative endpoint path for tenant retrieval in other services such as Data Acquisition; excluding “/api”

Example Configuration in JSON

{
"ServiceRegistry": {
"AccountServiceUrl": "http://localhost:8060",
"AuditServiceUrl": "http://localhost:8062",
"CensusServiceUrl": "http://localhost:8064",
"DataAcquisitionServiceUrl": "http://localhost:8065",
"MeasureServiceUrl": "http://localhost:8067",
"NormalizationServiceUrl": "http://localhost:8068",
"NotificationServiceUrl": "http://localhost:7434",
"QueryDispatchServiceUrl": "http://localhost:8071",
"ReportServiceUrl": "http://localhost:8072",
"SubmissionServiceUrl": "http://localhost:8073",
"TenantService": {
"TenantServiceUrl": "http://localhost:8074",
"CheckIfTenantExists": true,
"GetTenantRelativeEndpoint": "facility/"
},
"ValidationServiceUrl": "http://localhost:8075",
"TerminologyServiceUrl": "http://localhost:8076"
}
}

Tenant Service Configuration

PropertyDescriptionRequiredDefault
TenantService__TenantServiceUrlBase URL for the Tenant serviceYesNone
TenantService__CheckIfTenantExistsWhether to validate tenant existenceNotrue
TenantService__GetTenantRelativeEndpointRelative endpoint path for tenant retrievalNo”facility/“
FacilityIdSettings__NumericOnlyFacilityIdEnforce NHSN ORG ID format (5 digits)No PRD ONLYfalse

Databases

SQL Server Database

NameDescriptionRequiredDefault ValueSecret?
DatabaseProviderDatabase provider to useNoSqlServerNo
ConnectionStrings__DatabaseConnectionMSSQL connection stringYesNoneYes
AutoMigrateAutomatically migrate the database schemaNofalseNo

Mongo Database

NameDescriptionRequiredDefault ValueSecret?
MongoDB__ConnectionStringMongoDB connection stringYesNoneYes
MongoDB__DatabaseNameMongoDB database nameYesNoneNo

Service Information

The ServiceInformation configuration allows exposing build, version and deployment information through the /api/XXX/info (i.e. /api/audit/info) endpoint of each service. This information is automatically populated from assembly metadata and git information during build time.

PropertyDescriptionRequiredDefault ValueSecret?
ServiceInformation__ServiceNameDisplay name of the serviceNoVaries service by serviceNo
ServiceInformation__VersionVersion of the serviceNoAssembly ver.No
ServiceInformation__ProductVersionVersion of the product as a wholeNoN/ANo
ServiceInformation__BuildBuild number from CI/CD pipelineNo”dev” when using Docker ComposeNo
ServiceInformation__CommitGit commit hash of deployed versionNoNoneNo

The service automatically extracts information from .NET assembly version in the AssemblyInfo.cs file or project file