.NET 8 API + EFCore + Sentry + Azure AD Auth + TestContainers
-
appsettings.Local.json file should be created and used for configuration on local development (file is gitignored and should remain that way).
Sample configuration:{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Information" } }, "ConnectionStrings": { "Database": "Server=.;Database=Web_Api_Base;Integrated Security=True;Encrypt=False", "Test-Db": "Server=.;Integrated Security=True;Encrypt=False" // remove this if you want to run integration tests in docker } }
-
Db initialization
- SQL Server is used as the db engine
- EFCore migrations can be found in Infrastructure/Database/Migrations. To apply them follow one of the methods described here https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/applying
-
Sentry
- Provide
Sentry:Dsn
variable in your configuration.
- Provide
-
Azure AD
- Provide variables:
AzureAd:Domain
,AzureAd:TenantId
andAzureAd:ClientId
, in your configuration.
- Provide variables:
-
Integration Tests
Tests which are using Db can be run locally either in docker container or on local db engine.- In order to run tests in docker don't add ConnectionStrings:Test-Db in your env variables/configuration.
- If you want to run tests on local db engine then provide:
ConnectionStrings:Test-Db
(sample value:"Server=.;Integrated Security=True;Encrypt=False"
) variable in your configuration (appsettings.Local.json / env variables).