Skip to content

Commit

Permalink
Setup app insight in web api (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben0189 authored Oct 9, 2024
1 parent c2b1d94 commit 18b3826
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions blotztask-api/BlotzTask.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.2.0" />
<PackageReference Include="Azure.Security.KeyVault.Secrets" Version="4.6.0" />
<PackageReference Include="FluentValidation" Version="11.9.2" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.9.2" />
Expand Down
2 changes: 2 additions & 0 deletions blotztask-api/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Azure.Identity;
using Azure.Monitor.OpenTelemetry.AspNetCore;
using Azure.Security.KeyVault.Secrets;
using BlotzTask.Data;
using BlotzTask.Data.Entities;
Expand Down Expand Up @@ -61,6 +62,7 @@

var client = new SecretClient(new Uri(keyVaultEndpoint), new DefaultAzureCredential());

Check warning on line 63 in blotztask-api/Program.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'uriString' in 'Uri.Uri(string uriString)'.
builder.Services.AddDbContext<BlotzTaskDbContext>(options => options.UseSqlServer(client.GetSecret("db-string-connection").Value.Value.ToString()));
builder.Services.AddOpenTelemetry().UseAzureMonitor();

}

Expand Down

0 comments on commit 18b3826

Please sign in to comment.