Build status: add link from devops
Template Service is a Web API build on .NET Core 3.0 with supporting libraries.
It integrates Nuget packages:
- Application Insights - Gather and send service metrics to the Azure Application Insights
- Swagger - JSON documentation
- API Versioning - Versioning library
- Health Checks - Healthcheck library
- Polly - Http Resiliency library
- Serilog - Logging library (text, console)
When the repository is checkout, you should initialize secret.json file from the Visual Studio. Do that by right clicking WebAPi project and click "Manage user secrets". Then copy and paste json below and populate correct values.
{
"MjcTemplatesWebApi:AzureVault:Name": "...",
"MjcTemplatesWebApi:AzureRedis:InstanceName": "***.redis.cache.windows.net",
"MjcTemplatesWebApi:AzureRedis:Configuration": "redis connection string",
"MjcTemplatesWebApi:AzureAdB2C:Domain": "***.onmicrosoft.com",
"MjcTemplatesWebApi:AzureAdB2C:ClientId": "...",
"MjcTemplatesWebApi:ApplicationInsights:InstrumentationKey": "..."
}
There are two types of health checks:
It is located at /self
endpoint of the API and returns 200 - OK with Healthy body.
It is located at /ready
endpoint of the API and returns 200 - OK with Healthy body. It checks if all the services defined in heatlh checks are up.
It is located at /hc
and returnes a JSON for checks about Azure Key Vault and Swagger JSON file:
{
"checks": [
{
"description": "self",
"status": "Healthy",
"responseTime": "0,0029ms"
},
{
"description": "Dummy Check",
"status": "Healthy",
"responseTime": "0,0163ms"
}
],
"totalResponseTime": 12.8834
}
Azure DevOps build pipeline is defined in azure_pipelines.yaml
file.
Every environment and service has its own yaml
scripts that inherit some base properties from the base folder scripts.
- SQL database sample (Dapper, SQlCLient)
- Service bus sample
- Azure Storage sample
- service generator tool
- Authorization