Skip to content

Commit 573e956

Browse files
committed
chore(management-portal): remove DAB from infra, drop Aspire AppHost runtime, and ignore build outputs
1 parent 6f25d49 commit 573e956

16 files changed

+16
-173
lines changed

management-portal/AppHost/AppHost.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
<TargetFramework>net9.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7-
<IsAspireAppHost>true</IsAspireAppHost>
87
</PropertyGroup>
98
<ItemGroup>
109
<ProjectReference Include="..\src\Portal\Portal.csproj" />
1110
</ItemGroup>
1211
<ItemGroup>
13-
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.4.1" />
1412
</ItemGroup>
1513
</Project>
Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,11 @@
1-
using Aspire.Hosting;
1+
using System;
22

3-
var builder = DistributedApplication.CreateBuilder(args);
3+
// Minimal AppHost shim.
4+
// This project previously used the .NET Aspire AppHost runtime. That runtime and automatic DAB startup
5+
// have been removed. To run the portal locally, run the Portal project directly.
46

5-
// Make containerized resources optional to avoid requiring DCP when running `dotnet run`.
6-
var skipContainersEnv = Environment.GetEnvironmentVariable("ASPIRE_SKIP_CONTAINERS");
7-
var skipContainers = string.IsNullOrWhiteSpace(skipContainersEnv) || bool.TryParse(skipContainersEnv, out var val) && val;
7+
Console.WriteLine("AppHost shim: Aspire AppHost usage removed.");
8+
Console.WriteLine("Run the Portal directly with: dotnet run --project ..\\src\\Portal\\Portal.csproj");
9+
Console.WriteLine("Or use the one-command local script: pwsh -File ..\\..\\scripts\\run-local.ps1");
810

9-
if (!skipContainers)
10-
{
11-
// Cosmos DB Emulator (for local dev). If you prefer local emulator app, set COSMOS_CONNECTION_STRING externally and skip this container.
12-
var cosmosEmu = builder.AddContainer("cosmos", "mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator", tag: "latest")
13-
.WithEnvironment("AZURE_COSMOS_EMULATOR_ENABLE_TELEMETRY", "false")
14-
.WithEnvironment("AZURE_COSMOS_EMULATOR_PARTITION_COUNT", "3")
15-
.WithEnvironment("AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE", "true")
16-
.WithContainerRuntimeArgs("--cap-add=NET_ADMIN")
17-
.WithHttpEndpoint(port: 8085, targetPort: 8081, name: "cosmos"); // maps emulator 8081 -> 8085 on host
18-
19-
// Connection strings:
20-
// - Inside containers (same Docker/Aspire network): use the container hostname `cosmos` at port 8081.
21-
// - From the host (for local tools like the Seeder): use https://localhost:8085 mapped above.
22-
var cosmosConnForContainers = "AccountEndpoint=https://cosmos:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==;";
23-
var cosmosConnForHost = "AccountEndpoint=https://localhost:8085/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==;";
24-
25-
var dab = builder.AddContainer("dab", "mcr.microsoft.com/data-api-builder", tag: "latest")
26-
.WithBindMount("..\\dab\\dab-config.json", "/App/dab-config.json")
27-
.WithEnvironment("ASPNETCORE_URLS", "http://+:8082")
28-
// Prefer an explicit COSMOS_CONNECTION_STRING if provided by the user, otherwise default to the container-network connection.
29-
.WithEnvironment("COSMOS_CONNECTION_STRING", Environment.GetEnvironmentVariable("COSMOS_CONNECTION_STRING") ?? cosmosConnForContainers)
30-
// Provide COSMOS_CONNECTION_STRING via environment or user-secrets for DAB to connect to Cosmos
31-
.WithHttpEndpoint(port: 8082, name: "http")
32-
.WithArgs(["dab", "start", "--host", "0.0.0.0", "--config", "/App/dab-config.json"]);
33-
}
34-
35-
// (Optional) Run Seeder manually: dotnet run --project management-portal/Seeder
36-
37-
var portal = builder.AddProject("portal", "..\\src\\Portal\\Portal.csproj")
38-
.WithEnvironment("ASPNETCORE_URLS", "http://+:8081")
39-
.WithEnvironment("DAB_GRAPHQL_URL", "http://localhost:8082/graphql")
40-
.WithHttpEndpoint(port: 8081, name: "http");
41-
42-
builder.Build().Run();
11+
return 0;

management-portal/Aspire/ServiceDefaults/Extensions.cs

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

management-portal/Aspire/ServiceDefaults/ServiceDefaults.csproj

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

management-portal/README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,17 @@ For detailed authentication setup, see the main documentation: [DEPLOYMENT_GUIDE
2828
- GraphQL: <http://localhost:8082/graphql>
2929
- Cosmos Emulator: <https://localhost:8085>
3030

31-
## Local Run (AppHost)
31+
Local Run (AppHost)
3232

3333
- Build AppHost: dotnet build management-portal/AppHost
3434
- Run AppHost: dotnet run --project management-portal/AppHost
3535
- Portal URL: <http://localhost:8081>
3636

37-
Prereqs for Aspire run (CLI)
38-
39-
- .NET 9 SDK installed (9.0.4xx or newer)
40-
- .NET Aspire 9 workload and tools installed
41-
- dotnet workload install aspire
42-
- Ensure Aspire Hosting SDK pack is 9.x under C:\Program Files\dotnet\packs\Aspire.Hosting.Sdk
43-
- Install Aspire Distributed Control Plane (DCP) and Aspire Dashboard (via Visual Studio Installer > Individual components > .NET Aspire 9)
44-
- CLI: aspire --version should show 9.x
37+
Note: AppHost is no longer dependent on the .NET Aspire runtime for local runs. The portal hosts a built-in Hot Chocolate GraphQL endpoint and local scripts now rely on that endpoint.
4538

4639
Troubleshooting
4740

48-
- If aspire run says "not an Aspire app host project" or AppHost complains about missing DCP/Dashboard, install the Aspire 9 SDK pack and DCP/Dashboard as above.
49-
- Use the one-command local scripts as a fallback while you set up Aspire.
41+
- If you encounter issues running the portal locally, use the one-command local scripts `pwsh -File .\scripts\run-local.ps1` and `pwsh -File .\scripts\stop-local.ps1` which no longer start DAB automatically.
5042

5143
## Config
5244

management-portal/dapr-components/resiliency.yaml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,16 @@ spec:
1212
duration: 2s
1313
maxRetries: 3
1414
maxInterval: 30s
15-
dab-service-retry:
16-
policy: linear
17-
duration: 1s
18-
maxRetries: 5
19-
maxInterval: 10s
2015
circuitBreakers:
2116
azure-api-cb:
2217
maxRequests: 5
2318
timeout: 30s
2419
trip: consecutiveFailures >= 3
2520
resetInterval: 60s
26-
dab-service-cb:
27-
maxRequests: 10
28-
timeout: 15s
29-
trip: consecutiveFailures >= 5
30-
resetInterval: 30s
3121
timeouts:
3222
azure-api-timeout: 45s
33-
dab-service-timeout: 20s
3423
targets:
3524
apps:
36-
dab:
37-
retry: dab-service-retry
38-
circuitBreaker: dab-service-cb
39-
timeout: dab-service-timeout
4025
components:
4126
cache-store:
4227
retry: azure-api-retry
419 KB
Loading
327 KB
Loading
604 KB
Loading
675 KB
Loading

0 commit comments

Comments
 (0)