⛔ Never push sensitive information such as client id's, secrets or keys into repositories including in the README file ⛔
The Employer Demand API is responsible for storing an Employers request for training in an unavailable area for a Training Provider to pick up. The demand is created against a particular course taken from the courses-api and a location, which then a number of providers can then enquire about providing training for that employer
The Employer Demand API is a inner API consumed by das-apim-endpoints. All data is stored in a SQL database using EF Core and configuration is read from Azure Storage Configuration table.
- A clone of this repository
- A code editor that supports Azure functions and .Net 6.0
- Azure Storage Emulator if not running in DEV mode
- SQL Database if not running DEV mode
AppSettings.json file
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"ConfigurationStorageConnectionString": "UseDevelopmentStorage=true;",
"ConfigNames": "SFA.DAS.EmployerDemand.Api",
"EnvironmentName": "LOCAL",
"Version": "1.0",
"APPINSIGHTS_INSTRUMENTATIONKEY": ""
}
Azure Table Storage config
Row Key: SFA.DAS.EmployerDemand.Api._1.0
Partition Key: LOCAL
Data:
{
"EmployerDemandConfiguration": {
"ConnectionString": "Data Source=.;Initial Catalog=SFA.DAS.EmployerDemand;Integrated Security=True;Pooling=False;Connect Timeout=30"
},
"AzureAd": {
"tenant": "",
"identifier": ""
}
}
It is possible to run the whole of the API using the InMemory database. To do this the environment variable in appsettings.json should be set to DEV. Once done, start the application as normal. You will then be able to query the API as per the operations listed in swagger.
You are able to run the API by doing the following:
- Run the database deployment publish command to create the database SFA.DAS.EmployerDemand or create the database manually and run in the table creation scripts
- In your Azure Storage Account, create the configuration as detailed above.
- Start the API project - this will load the swagger definition with all endpoints defined.
Authentication is managed via Azure Managed Identity when not running locally.
- .NetCore 6.0
- EF Core
- SQL Server
- NLog
- Azure Table Storage
- NUnit
- Moq
- FluentAssertions
- Do not run in IISExpress