mirror of
https://github.com/Shchoholiev/shopping-assistant-api.git
synced 2025-04-12 01:48:49 +00:00
Merge pull request #12 from Shchoholiev/feature/SA-72-azure-configuration
SA-72 Azure configuration
This commit is contained in:
commit
4edf221b9c
@ -4,9 +4,6 @@
|
|||||||
name: Build and deploy ASP.Net Core app to Azure Web App - shopping-assistant-api-dev
|
name: Build and deploy ASP.Net Core app to Azure Web App - shopping-assistant-api-dev
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- develop
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -25,6 +22,9 @@ jobs:
|
|||||||
- name: Build with dotnet
|
- name: Build with dotnet
|
||||||
run: dotnet build --configuration Release
|
run: dotnet build --configuration Release
|
||||||
|
|
||||||
|
- name: Test with dotnet
|
||||||
|
run: dotnet test --no-build --verbosity normal
|
||||||
|
|
||||||
- name: dotnet publish
|
- name: dotnet publish
|
||||||
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
|
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
environment:
|
environment:
|
||||||
name: 'Production'
|
name: 'Development'
|
||||||
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
|
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@ -6,6 +6,8 @@ using ShoppingAssistantApi.Api.ApiExtentions;
|
|||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
// Add services to the container.
|
// 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
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||||
builder.Services.AddJWTTokenAuthentication(builder.Configuration);
|
builder.Services.AddJWTTokenAuthentication(builder.Configuration);
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
<PackageReference Include="HotChocolate.AspNetCore" Version="13.3.3" />
|
<PackageReference Include="HotChocolate.AspNetCore" Version="13.3.3" />
|
||||||
<PackageReference Include="HotChocolate.AspNetCore.Authorization" Version="13.3.3" />
|
<PackageReference Include="HotChocolate.AspNetCore.Authorization" Version="13.3.3" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.5" />
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.5" />
|
||||||
|
<PackageReference Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="6.1.1" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@ -5,5 +5,17 @@
|
|||||||
"Microsoft.AspNetCore": "Warning"
|
"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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user