diff --git a/.github/workflows/develop_shopping-assistant-api-dev.yml b/.github/workflows/develop_shopping-assistant-api-dev.yml
index 11c692d..e24cb0d 100644
--- a/.github/workflows/develop_shopping-assistant-api-dev.yml
+++ b/.github/workflows/develop_shopping-assistant-api-dev.yml
@@ -4,9 +4,6 @@
name: Build and deploy ASP.Net Core app to Azure Web App - shopping-assistant-api-dev
on:
- push:
- branches:
- - develop
workflow_dispatch:
jobs:
@@ -25,6 +22,9 @@ jobs:
- name: Build with dotnet
run: dotnet build --configuration Release
+ - name: Test with dotnet
+ run: dotnet test --no-build --verbosity normal
+
- name: dotnet publish
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
@@ -38,7 +38,7 @@ jobs:
runs-on: ubuntu-latest
needs: build
environment:
- name: 'Production'
+ name: 'Development'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
diff --git a/ShoppingAssistantApi.Api/Program.cs b/ShoppingAssistantApi.Api/Program.cs
index e7f574b..6d67dd6 100644
--- a/ShoppingAssistantApi.Api/Program.cs
+++ b/ShoppingAssistantApi.Api/Program.cs
@@ -6,6 +6,8 @@ using ShoppingAssistantApi.Api.ApiExtentions;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
+var appConfig = Environment.GetEnvironmentVariable("APP_CONFIG") ?? builder.Configuration.GetConnectionString("AppConfig");
+builder.Configuration.AddAzureAppConfiguration(appConfig);
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddJWTTokenAuthentication(builder.Configuration);
diff --git a/ShoppingAssistantApi.Api/ShoppingAssistantApi.Api.csproj b/ShoppingAssistantApi.Api/ShoppingAssistantApi.Api.csproj
index 761a282..e38ca43 100644
--- a/ShoppingAssistantApi.Api/ShoppingAssistantApi.Api.csproj
+++ b/ShoppingAssistantApi.Api/ShoppingAssistantApi.Api.csproj
@@ -11,6 +11,7 @@
+
diff --git a/ShoppingAssistantApi.Api/appsettings.json b/ShoppingAssistantApi.Api/appsettings.json
index 10f68b8..a018db4 100644
--- a/ShoppingAssistantApi.Api/appsettings.json
+++ b/ShoppingAssistantApi.Api/appsettings.json
@@ -5,5 +5,17 @@
"Microsoft.AspNetCore": "Warning"
}
},
- "AllowedHosts": "*"
+ "AllowedHosts": "*",
+ "ConnectionStrings": {
+ "MongoDatabaseName": "ShoppingAssistant"
+ },
+ "JsonWebTokenKeys": {
+ "ValidateIssuer": true,
+ "ValidateAudience": true,
+ "ValidateLifetime": true,
+ "ValidateIssuerSigningKey": true
+ },
+ "OpenAi": {
+ "ApiUrl": "https://api.openai.com/v1/chat/completions"
+ }
}