https://github.com/thiagoloureiro/webapibase.net8
.NET 8 API + EF + Sentry + Azure AD Auth + Dockerfile + Swagger XML
https://github.com/thiagoloureiro/webapibase.net8
Last synced: 3 months ago
JSON representation
.NET 8 API + EF + Sentry + Azure AD Auth + Dockerfile + Swagger XML
- Host: GitHub
- URL: https://github.com/thiagoloureiro/webapibase.net8
- Owner: thiagoloureiro
- Created: 2024-01-08T10:15:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-11T12:54:00.000Z (over 1 year ago)
- Last Synced: 2025-02-01T00:29:15.848Z (5 months ago)
- Language: C#
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WebAPIBase.NET8
.NET 8 API + EFCore + Sentry + Azure AD Auth + TestContainers## Local Environment Configuration
1. appsettings.Local.json file should be created and used for configuration on local development (file is gitignored and should remain that way).
Sample configuration:```json
{
"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
}
}
```
2. 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/applying3. Sentry
- Provide `Sentry:Dsn` variable in your configuration.4. Azure AD
- Provide variables: `AzureAd:Domain`, `AzureAd:TenantId` and `AzureAd:ClientId`, in your configuration.5. 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).