Skip to content

Commit

Permalink
Add Local appsettings
Browse files Browse the repository at this point in the history
and disable Application Insights Telemetry locally and when debugging
  • Loading branch information
tsundvoll committed Dec 13, 2023
1 parent 17564bd commit 9847d04
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backend/api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Api.Services.ActionServices;
using Api.SignalRHubs;
using Azure.Identity;
using Microsoft.ApplicationInsights.Extensibility.Implementation;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Http.Connections;
using Microsoft.AspNetCore.Rewrite;
Expand Down Expand Up @@ -49,6 +50,11 @@

builder.Services.AddApplicationInsightsTelemetry();

// Disable Application Insights Telemetry when debugging
#if DEBUG
TelemetryDebugWriter.IsTracingDisabled = true;
#endif

builder.Services.AddScoped<IAccessRoleService, AccessRoleService>();
builder.Services.AddScoped<IRobotService, RobotService>();
builder.Services.AddScoped<IMissionRunService, MissionRunService>();
Expand Down
51 changes: 51 additions & 0 deletions backend/api/appsettings.Local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"AzureAd": {
"ClientId": "ea4c7b92-47b3-45fb-bd25-a8070f0c495c",
"ClientSecret": "Fill in ASP.NET Secret Manager"
},
"KeyVault": {
"VaultUri": "https://flotilladevkv.vault.azure.net/"
},
"Isar": {
"Scopes": [
"fd384acd-5c1b-4c44-a1ac-d41d720ed0fe/.default"
]
},
"Maps": {
"StorageAccount": "flotillamaps"
},
"AllowedHosts": "*",
"AllowedOrigins": [
"https://*.equinor.com/",
"http://localhost:3001",
"https://localhost:3001"
],
"Mqtt": {
"Host": "localhost",
"Port": 1883,
"Username": "flotilla",
"Topics": [
"isar/+/robot_status",
"isar/+/robot_info",
"isar/+/robot_heartbeat",
"isar/+/mission",
"isar/+/task",
"isar/+/step",
"isar/+/battery",
"isar/+/pressure",
"isar/+/pose"
],
"MaxRetryAttempts": 5,
"ShouldFailOnMaxRetries": false
},
"Blob": {
"CustomMissionContainerName": "custommission",
"AccountName": "flotilladevsa"
},
"Database": {
"UseInMemoryDatabase": true
},
"ApplicationInsights": {
"ConnectionString": ""
}
}

0 comments on commit 9847d04

Please sign in to comment.