Skip to content

Commit c53ece9

Browse files
Merge pull request #458 from microsoft/waf-prdc
feat: Implemented WAF for Infrastructure
2 parents 5f7fc6f + 970a8dd commit c53ece9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+53539
-3205
lines changed

App/backend-api/Microsoft.GS.DPS.Host/DependencyConfiguration/ServiceDependencies.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using Microsoft.GS.DPS.Storage.AISearch;
1313
using Microsoft.GS.DPSHost.AppConfiguration;
1414
using Microsoft.Extensions.DependencyInjection;
15+
using Microsoft.GS.DPSHost.Helpers;
1516

1617
namespace Microsoft.GS.DPSHost.ServiceConfiguration
1718
{
@@ -31,7 +32,7 @@ public static void Inject(IHostApplicationBuilder builder)
3132
return Kernel.CreateBuilder()
3233
.AddAzureOpenAIChatCompletion(deploymentName: builder.Configuration.GetSection("Application:AIServices:GPT-4o-mini")["ModelName"] ?? "",
3334
endpoint: builder.Configuration.GetSection("Application:AIServices:GPT-4o-mini")["Endpoint"] ?? "",
34-
apiKey: builder.Configuration.GetSection("Application:AIServices:GPT-4o-mini")["Key"] ?? "")
35+
credentials: AzureCredentialHelper.GetAzureCredential())
3536

3637
.Build();
3738
})
@@ -66,7 +67,7 @@ public static void Inject(IHostApplicationBuilder builder)
6667
.AddSingleton<TagUpdater>(x =>
6768
{
6869
var services = x.GetRequiredService<IOptions<Services>>().Value;
69-
return new TagUpdater(services.AzureAISearch.Endpoint, services.AzureAISearch.APIKey);
70+
return new TagUpdater(services.AzureAISearch.Endpoint, AzureCredentialHelper.GetAzureCredential());
7071

7172
})
7273

App/backend-api/Microsoft.GS.DPS/Microsoft.GS.DPS.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
<ItemGroup>
1010
<PackageReference Include="AutoMapper" Version="14.0.0" />
11+
<PackageReference Include="Azure.Identity" Version="1.14.1" />
1112
<PackageReference Include="Azure.Search.Documents" Version="11.6.1" />
1213
<PackageReference Include="FluentValidation" Version="12.0.0" />
1314
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="12.0.0" />

App/backend-api/Microsoft.GS.DPS/Storage/AISearch/TagUpdater.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Linq;
44
using System.Threading.Tasks;
55
using Azure;
6+
using Azure.Core;
67
using Azure.Search.Documents;
78
using Azure.Search.Documents.Models;
89

@@ -12,9 +13,9 @@ public class TagUpdater
1213
{
1314
private readonly SearchClient _searchClient;
1415

15-
public TagUpdater(string searchEndPoint, string searchAPIKey, string indexName = "default")
16+
public TagUpdater(string searchEndPoint, TokenCredential tokenCredential, string indexName = "default")
1617
{
17-
_searchClient = new SearchClient(new Uri(searchEndPoint), indexName, new AzureKeyCredential(searchAPIKey));
18+
_searchClient = new SearchClient(new Uri(searchEndPoint), indexName, tokenCredential);
1819
}
1920

2021
public async Task UpdateTags(string documentId, List<string> updatingTags)

App/kernel-memory/infra/main.bicep

Lines changed: 0 additions & 238 deletions
This file was deleted.

0 commit comments

Comments
 (0)