From 4542faec4f467cf6f8203b5300ea6208cd6198ec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 30 Nov 2025 17:50:33 +0000 Subject: [PATCH 1/4] Initial plan From 9c6bc4e245924c8c8b0fe0b218687546667337ea Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 30 Nov 2025 18:01:24 +0000 Subject: [PATCH 2/4] Add .NET Aspire integration for improved development experience Co-authored-by: Jawz84 <26464885+Jawz84@users.noreply.github.com> --- README.md | 36 ++++- explainpowershell.apphost/AppHost.cs | 21 +++ .../Properties/launchSettings.json | 31 +++++ .../appsettings.Development.json | 8 ++ explainpowershell.apphost/appsettings.json | 9 ++ .../explainpowershell.apphost.csproj | 21 +++ .../Extensions.cs | 127 ++++++++++++++++++ .../explainpowershell.servicedefaults.csproj | 22 +++ explainpowershell.sln | 82 ++++++++++- 9 files changed, 352 insertions(+), 5 deletions(-) create mode 100644 explainpowershell.apphost/AppHost.cs create mode 100644 explainpowershell.apphost/Properties/launchSettings.json create mode 100644 explainpowershell.apphost/appsettings.Development.json create mode 100644 explainpowershell.apphost/appsettings.json create mode 100644 explainpowershell.apphost/explainpowershell.apphost.csproj create mode 100644 explainpowershell.servicedefaults/Extensions.cs create mode 100644 explainpowershell.servicedefaults/explainpowershell.servicedefaults.csproj diff --git a/README.md b/README.md index 86ffaf2..3bc9326 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,41 @@ I envision something like this: ## Development -The repo now runs directly on your host machine; no devcontainers are required. A typical setup looks like this: +There are two ways to run the development environment: using .NET Aspire (recommended) or the traditional manual setup. + +### Option 1: Using .NET Aspire (Recommended) + +.NET Aspire provides a streamlined development experience with automatic orchestration of all services, including the Azurite storage emulator. + +**Prerequisites:** +- .NET 10 SDK +- PowerShell 7.4+ +- Docker (for Azurite emulation) +- Azure Functions Core Tools v4 + +**Getting Started:** + +1. Clone the repository and run the code generators and bootstrap script: + ```powershell + ./bootstrap.ps1 + ``` + +2. Start all services with a single command: + ```powershell + dotnet run --project explainpowershell.apphost + ``` + +3. Open the Aspire dashboard (URL shown in console output) to monitor all services, view logs, and access the frontend. + +The Aspire AppHost automatically: +- Starts the Azurite storage emulator in Docker +- Launches the Azure Functions backend (analysis service) +- Starts the Blazor WebAssembly frontend +- Provides a unified dashboard for monitoring and debugging + +### Option 2: Traditional Manual Setup + +If you prefer not to use Aspire, you can still run the repo directly on your host machine: 1. Install prerequisites: the latest .NET SDK (currently 10.x), Azure Functions Core Tools v4, PowerShell 7.4+, and the VS Code extensions recommended in `.vscode/extensions.json` (notably the Azurite extension `azurite.azurite`). 2. Clone the repository and open it in VS Code. Run `./bootstrap.ps1` from the repo root once to install PowerShell modules, restore dependencies, seed the Azurite table storage, and run the backend tests. The Azure Function backend now runs as a .NET 10 isolated worker, so make sure the `FUNCTIONS_WORKER_RUNTIME` remains `dotnet-isolated` in `local.settings.json`. diff --git a/explainpowershell.apphost/AppHost.cs b/explainpowershell.apphost/AppHost.cs new file mode 100644 index 0000000..b0f0450 --- /dev/null +++ b/explainpowershell.apphost/AppHost.cs @@ -0,0 +1,21 @@ +var builder = DistributedApplication.CreateBuilder(args); + +// Configure Azure Storage emulator (Azurite) for local development +var storage = builder.AddAzureStorage("storage") + .RunAsEmulator(); + +// Add the Azure Table storage resource used by the analysis service +var tables = storage.AddTables("tables"); + +// Add the Azure Functions analysis service backend +var analysisService = builder.AddAzureFunctionsProject("analysisservice") + .WithReference(tables) + .WaitFor(tables); + +// Add the Blazor WebAssembly frontend as a static web app +// Note: Blazor WASM runs in the browser - the appsettings.json configures the BaseAddress +// to point to the analysis service at http://localhost:7071/api/ +builder.AddProject("frontend") + .WithExternalHttpEndpoints(); + +builder.Build().Run(); diff --git a/explainpowershell.apphost/Properties/launchSettings.json b/explainpowershell.apphost/Properties/launchSettings.json new file mode 100644 index 0000000..c751e22 --- /dev/null +++ b/explainpowershell.apphost/Properties/launchSettings.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:17269;http://localhost:15100", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "DOTNET_ENVIRONMENT": "Development", + "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21042", + "ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "https://localhost:23140", + "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22004" + } + }, + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:15100", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "DOTNET_ENVIRONMENT": "Development", + "ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19069", + "ASPIRE_DASHBOARD_MCP_ENDPOINT_URL": "http://localhost:18210", + "ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20141" + } + } + } +} diff --git a/explainpowershell.apphost/appsettings.Development.json b/explainpowershell.apphost/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/explainpowershell.apphost/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/explainpowershell.apphost/appsettings.json b/explainpowershell.apphost/appsettings.json new file mode 100644 index 0000000..31c092a --- /dev/null +++ b/explainpowershell.apphost/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Aspire.Hosting.Dcp": "Warning" + } + } +} diff --git a/explainpowershell.apphost/explainpowershell.apphost.csproj b/explainpowershell.apphost/explainpowershell.apphost.csproj new file mode 100644 index 0000000..6b4c494 --- /dev/null +++ b/explainpowershell.apphost/explainpowershell.apphost.csproj @@ -0,0 +1,21 @@ + + + + Exe + net10.0 + enable + enable + a821ac25-3c11-4be4-9c85-e1a4f69591e5 + + + + + + + + + + + + + diff --git a/explainpowershell.servicedefaults/Extensions.cs b/explainpowershell.servicedefaults/Extensions.cs new file mode 100644 index 0000000..b72c875 --- /dev/null +++ b/explainpowershell.servicedefaults/Extensions.cs @@ -0,0 +1,127 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Diagnostics.HealthChecks; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Diagnostics.HealthChecks; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.ServiceDiscovery; +using OpenTelemetry; +using OpenTelemetry.Metrics; +using OpenTelemetry.Trace; + +namespace Microsoft.Extensions.Hosting; + +// Adds common Aspire services: service discovery, resilience, health checks, and OpenTelemetry. +// This project should be referenced by each service project in your solution. +// To learn more about using this project, see https://aka.ms/dotnet/aspire/service-defaults +public static class Extensions +{ + private const string HealthEndpointPath = "/health"; + private const string AlivenessEndpointPath = "/alive"; + + public static TBuilder AddServiceDefaults(this TBuilder builder) where TBuilder : IHostApplicationBuilder + { + builder.ConfigureOpenTelemetry(); + + builder.AddDefaultHealthChecks(); + + builder.Services.AddServiceDiscovery(); + + builder.Services.ConfigureHttpClientDefaults(http => + { + // Turn on resilience by default + http.AddStandardResilienceHandler(); + + // Turn on service discovery by default + http.AddServiceDiscovery(); + }); + + // Uncomment the following to restrict the allowed schemes for service discovery. + // builder.Services.Configure(options => + // { + // options.AllowedSchemes = ["https"]; + // }); + + return builder; + } + + public static TBuilder ConfigureOpenTelemetry(this TBuilder builder) where TBuilder : IHostApplicationBuilder + { + builder.Logging.AddOpenTelemetry(logging => + { + logging.IncludeFormattedMessage = true; + logging.IncludeScopes = true; + }); + + builder.Services.AddOpenTelemetry() + .WithMetrics(metrics => + { + metrics.AddAspNetCoreInstrumentation() + .AddHttpClientInstrumentation() + .AddRuntimeInstrumentation(); + }) + .WithTracing(tracing => + { + tracing.AddSource(builder.Environment.ApplicationName) + .AddAspNetCoreInstrumentation(tracing => + // Exclude health check requests from tracing + tracing.Filter = context => + !context.Request.Path.StartsWithSegments(HealthEndpointPath) + && !context.Request.Path.StartsWithSegments(AlivenessEndpointPath) + ) + // Uncomment the following line to enable gRPC instrumentation (requires the OpenTelemetry.Instrumentation.GrpcNetClient package) + //.AddGrpcClientInstrumentation() + .AddHttpClientInstrumentation(); + }); + + builder.AddOpenTelemetryExporters(); + + return builder; + } + + private static TBuilder AddOpenTelemetryExporters(this TBuilder builder) where TBuilder : IHostApplicationBuilder + { + var useOtlpExporter = !string.IsNullOrWhiteSpace(builder.Configuration["OTEL_EXPORTER_OTLP_ENDPOINT"]); + + if (useOtlpExporter) + { + builder.Services.AddOpenTelemetry().UseOtlpExporter(); + } + + // Uncomment the following lines to enable the Azure Monitor exporter (requires the Azure.Monitor.OpenTelemetry.AspNetCore package) + //if (!string.IsNullOrEmpty(builder.Configuration["APPLICATIONINSIGHTS_CONNECTION_STRING"])) + //{ + // builder.Services.AddOpenTelemetry() + // .UseAzureMonitor(); + //} + + return builder; + } + + public static TBuilder AddDefaultHealthChecks(this TBuilder builder) where TBuilder : IHostApplicationBuilder + { + builder.Services.AddHealthChecks() + // Add a default liveness check to ensure app is responsive + .AddCheck("self", () => HealthCheckResult.Healthy(), ["live"]); + + return builder; + } + + public static WebApplication MapDefaultEndpoints(this WebApplication app) + { + // Adding health checks endpoints to applications in non-development environments has security implications. + // See https://aka.ms/dotnet/aspire/healthchecks for details before enabling these endpoints in non-development environments. + if (app.Environment.IsDevelopment()) + { + // All health checks must pass for app to be considered ready to accept traffic after starting + app.MapHealthChecks(HealthEndpointPath); + + // Only health checks tagged with the "live" tag must pass for app to be considered alive + app.MapHealthChecks(AlivenessEndpointPath, new HealthCheckOptions + { + Predicate = r => r.Tags.Contains("live") + }); + } + + return app; + } +} diff --git a/explainpowershell.servicedefaults/explainpowershell.servicedefaults.csproj b/explainpowershell.servicedefaults/explainpowershell.servicedefaults.csproj new file mode 100644 index 0000000..0eaff94 --- /dev/null +++ b/explainpowershell.servicedefaults/explainpowershell.servicedefaults.csproj @@ -0,0 +1,22 @@ + + + + net10.0 + enable + enable + true + + + + + + + + + + + + + + + diff --git a/explainpowershell.sln b/explainpowershell.sln index 557cd95..78fd627 100644 --- a/explainpowershell.sln +++ b/explainpowershell.sln @@ -11,39 +11,113 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "explainpowershell.models", EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "explainpowershell.helpcollector", "explainpowershell.helpcollector", "{56F173B4-132E-4ADA-A154-7914BC2ECF6C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tools", "explainpowershell.helpcollector\tools\explainpowershell.helpcollector.tools.csproj", "{6854D7F5-13D2-4363-A699-88F3802FC917}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "explainpowershell.helpcollector.tools", "explainpowershell.helpcollector\tools\explainpowershell.helpcollector.tools.csproj", "{6854D7F5-13D2-4363-A699-88F3802FC917}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "explainpowershell.analysisservice.tests", "explainpowershell.analysisservice.tests\explainpowershell.analysisservice.tests.csproj", "{37C8F882-8BFA-483B-80B6-CBA18387AEE0}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "explainpowershell.apphost", "explainpowershell.apphost\explainpowershell.apphost.csproj", "{C384B7C8-89B5-4B11-BF26-F50F6A17449A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "explainpowershell.analysisservice", "explainpowershell.analysisservice", "{157C0F88-4EC3-E7DE-5FB7-15C32019D3AE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "explainpowershell.servicedefaults", "explainpowershell.servicedefaults\explainpowershell.servicedefaults.csproj", "{1845B25D-230B-4F78-9F37-2AC9CEABEDDE}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {3ECDCF7D-284D-4958-B776-ED49218DAD3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3ECDCF7D-284D-4958-B776-ED49218DAD3B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3ECDCF7D-284D-4958-B776-ED49218DAD3B}.Debug|x64.ActiveCfg = Debug|Any CPU + {3ECDCF7D-284D-4958-B776-ED49218DAD3B}.Debug|x64.Build.0 = Debug|Any CPU + {3ECDCF7D-284D-4958-B776-ED49218DAD3B}.Debug|x86.ActiveCfg = Debug|Any CPU + {3ECDCF7D-284D-4958-B776-ED49218DAD3B}.Debug|x86.Build.0 = Debug|Any CPU {3ECDCF7D-284D-4958-B776-ED49218DAD3B}.Release|Any CPU.ActiveCfg = Release|Any CPU {3ECDCF7D-284D-4958-B776-ED49218DAD3B}.Release|Any CPU.Build.0 = Release|Any CPU + {3ECDCF7D-284D-4958-B776-ED49218DAD3B}.Release|x64.ActiveCfg = Release|Any CPU + {3ECDCF7D-284D-4958-B776-ED49218DAD3B}.Release|x64.Build.0 = Release|Any CPU + {3ECDCF7D-284D-4958-B776-ED49218DAD3B}.Release|x86.ActiveCfg = Release|Any CPU + {3ECDCF7D-284D-4958-B776-ED49218DAD3B}.Release|x86.Build.0 = Release|Any CPU {8D32B3F4-A053-4A62-8432-6567CAFFE290}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8D32B3F4-A053-4A62-8432-6567CAFFE290}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8D32B3F4-A053-4A62-8432-6567CAFFE290}.Debug|x64.ActiveCfg = Debug|Any CPU + {8D32B3F4-A053-4A62-8432-6567CAFFE290}.Debug|x64.Build.0 = Debug|Any CPU + {8D32B3F4-A053-4A62-8432-6567CAFFE290}.Debug|x86.ActiveCfg = Debug|Any CPU + {8D32B3F4-A053-4A62-8432-6567CAFFE290}.Debug|x86.Build.0 = Debug|Any CPU {8D32B3F4-A053-4A62-8432-6567CAFFE290}.Release|Any CPU.ActiveCfg = Release|Any CPU {8D32B3F4-A053-4A62-8432-6567CAFFE290}.Release|Any CPU.Build.0 = Release|Any CPU + {8D32B3F4-A053-4A62-8432-6567CAFFE290}.Release|x64.ActiveCfg = Release|Any CPU + {8D32B3F4-A053-4A62-8432-6567CAFFE290}.Release|x64.Build.0 = Release|Any CPU + {8D32B3F4-A053-4A62-8432-6567CAFFE290}.Release|x86.ActiveCfg = Release|Any CPU + {8D32B3F4-A053-4A62-8432-6567CAFFE290}.Release|x86.Build.0 = Release|Any CPU {CE997188-9CE9-43F5-AFAA-670D28222C23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CE997188-9CE9-43F5-AFAA-670D28222C23}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE997188-9CE9-43F5-AFAA-670D28222C23}.Debug|x64.ActiveCfg = Debug|Any CPU + {CE997188-9CE9-43F5-AFAA-670D28222C23}.Debug|x64.Build.0 = Debug|Any CPU + {CE997188-9CE9-43F5-AFAA-670D28222C23}.Debug|x86.ActiveCfg = Debug|Any CPU + {CE997188-9CE9-43F5-AFAA-670D28222C23}.Debug|x86.Build.0 = Debug|Any CPU {CE997188-9CE9-43F5-AFAA-670D28222C23}.Release|Any CPU.ActiveCfg = Release|Any CPU {CE997188-9CE9-43F5-AFAA-670D28222C23}.Release|Any CPU.Build.0 = Release|Any CPU + {CE997188-9CE9-43F5-AFAA-670D28222C23}.Release|x64.ActiveCfg = Release|Any CPU + {CE997188-9CE9-43F5-AFAA-670D28222C23}.Release|x64.Build.0 = Release|Any CPU + {CE997188-9CE9-43F5-AFAA-670D28222C23}.Release|x86.ActiveCfg = Release|Any CPU + {CE997188-9CE9-43F5-AFAA-670D28222C23}.Release|x86.Build.0 = Release|Any CPU {6854D7F5-13D2-4363-A699-88F3802FC917}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6854D7F5-13D2-4363-A699-88F3802FC917}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6854D7F5-13D2-4363-A699-88F3802FC917}.Debug|x64.ActiveCfg = Debug|Any CPU + {6854D7F5-13D2-4363-A699-88F3802FC917}.Debug|x64.Build.0 = Debug|Any CPU + {6854D7F5-13D2-4363-A699-88F3802FC917}.Debug|x86.ActiveCfg = Debug|Any CPU + {6854D7F5-13D2-4363-A699-88F3802FC917}.Debug|x86.Build.0 = Debug|Any CPU {6854D7F5-13D2-4363-A699-88F3802FC917}.Release|Any CPU.ActiveCfg = Release|Any CPU {6854D7F5-13D2-4363-A699-88F3802FC917}.Release|Any CPU.Build.0 = Release|Any CPU + {6854D7F5-13D2-4363-A699-88F3802FC917}.Release|x64.ActiveCfg = Release|Any CPU + {6854D7F5-13D2-4363-A699-88F3802FC917}.Release|x64.Build.0 = Release|Any CPU + {6854D7F5-13D2-4363-A699-88F3802FC917}.Release|x86.ActiveCfg = Release|Any CPU + {6854D7F5-13D2-4363-A699-88F3802FC917}.Release|x86.Build.0 = Release|Any CPU {37C8F882-8BFA-483B-80B6-CBA18387AEE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {37C8F882-8BFA-483B-80B6-CBA18387AEE0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {37C8F882-8BFA-483B-80B6-CBA18387AEE0}.Debug|x64.ActiveCfg = Debug|Any CPU + {37C8F882-8BFA-483B-80B6-CBA18387AEE0}.Debug|x64.Build.0 = Debug|Any CPU + {37C8F882-8BFA-483B-80B6-CBA18387AEE0}.Debug|x86.ActiveCfg = Debug|Any CPU + {37C8F882-8BFA-483B-80B6-CBA18387AEE0}.Debug|x86.Build.0 = Debug|Any CPU {37C8F882-8BFA-483B-80B6-CBA18387AEE0}.Release|Any CPU.ActiveCfg = Release|Any CPU {37C8F882-8BFA-483B-80B6-CBA18387AEE0}.Release|Any CPU.Build.0 = Release|Any CPU + {37C8F882-8BFA-483B-80B6-CBA18387AEE0}.Release|x64.ActiveCfg = Release|Any CPU + {37C8F882-8BFA-483B-80B6-CBA18387AEE0}.Release|x64.Build.0 = Release|Any CPU + {37C8F882-8BFA-483B-80B6-CBA18387AEE0}.Release|x86.ActiveCfg = Release|Any CPU + {37C8F882-8BFA-483B-80B6-CBA18387AEE0}.Release|x86.Build.0 = Release|Any CPU + {C384B7C8-89B5-4B11-BF26-F50F6A17449A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C384B7C8-89B5-4B11-BF26-F50F6A17449A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C384B7C8-89B5-4B11-BF26-F50F6A17449A}.Debug|x64.ActiveCfg = Debug|Any CPU + {C384B7C8-89B5-4B11-BF26-F50F6A17449A}.Debug|x64.Build.0 = Debug|Any CPU + {C384B7C8-89B5-4B11-BF26-F50F6A17449A}.Debug|x86.ActiveCfg = Debug|Any CPU + {C384B7C8-89B5-4B11-BF26-F50F6A17449A}.Debug|x86.Build.0 = Debug|Any CPU + {C384B7C8-89B5-4B11-BF26-F50F6A17449A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C384B7C8-89B5-4B11-BF26-F50F6A17449A}.Release|Any CPU.Build.0 = Release|Any CPU + {C384B7C8-89B5-4B11-BF26-F50F6A17449A}.Release|x64.ActiveCfg = Release|Any CPU + {C384B7C8-89B5-4B11-BF26-F50F6A17449A}.Release|x64.Build.0 = Release|Any CPU + {C384B7C8-89B5-4B11-BF26-F50F6A17449A}.Release|x86.ActiveCfg = Release|Any CPU + {C384B7C8-89B5-4B11-BF26-F50F6A17449A}.Release|x86.Build.0 = Release|Any CPU + {1845B25D-230B-4F78-9F37-2AC9CEABEDDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1845B25D-230B-4F78-9F37-2AC9CEABEDDE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1845B25D-230B-4F78-9F37-2AC9CEABEDDE}.Debug|x64.ActiveCfg = Debug|Any CPU + {1845B25D-230B-4F78-9F37-2AC9CEABEDDE}.Debug|x64.Build.0 = Debug|Any CPU + {1845B25D-230B-4F78-9F37-2AC9CEABEDDE}.Debug|x86.ActiveCfg = Debug|Any CPU + {1845B25D-230B-4F78-9F37-2AC9CEABEDDE}.Debug|x86.Build.0 = Debug|Any CPU + {1845B25D-230B-4F78-9F37-2AC9CEABEDDE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1845B25D-230B-4F78-9F37-2AC9CEABEDDE}.Release|Any CPU.Build.0 = Release|Any CPU + {1845B25D-230B-4F78-9F37-2AC9CEABEDDE}.Release|x64.ActiveCfg = Release|Any CPU + {1845B25D-230B-4F78-9F37-2AC9CEABEDDE}.Release|x64.Build.0 = Release|Any CPU + {1845B25D-230B-4F78-9F37-2AC9CEABEDDE}.Release|x86.ActiveCfg = Release|Any CPU + {1845B25D-230B-4F78-9F37-2AC9CEABEDDE}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {6854D7F5-13D2-4363-A699-88F3802FC917} = {56F173B4-132E-4ADA-A154-7914BC2ECF6C} From 27840904c5b14babf9ea777d2fc603fc12d80954 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 30 Nov 2025 18:03:40 +0000 Subject: [PATCH 3/4] Fix launchSettings.json dotnetRunMessages type for Aspire compatibility Co-authored-by: Jawz84 <26464885+Jawz84@users.noreply.github.com> --- explainpowershell.frontend/Properties/launchSettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/explainpowershell.frontend/Properties/launchSettings.json b/explainpowershell.frontend/Properties/launchSettings.json index 7c0e339..ec65e74 100644 --- a/explainpowershell.frontend/Properties/launchSettings.json +++ b/explainpowershell.frontend/Properties/launchSettings.json @@ -24,7 +24,7 @@ }, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "applicationUrl": "https://localhost:5001;http://localhost:5000", - "dotnetRunMessages": "true" + "dotnetRunMessages": true }, "WSL": { "commandName": "WSL2", From 8af586be0511be917e913acc4aa8850adb8182fc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 30 Nov 2025 18:17:34 +0000 Subject: [PATCH 4/4] Remove Docker requirement - use VS Code Azurite extension instead Co-authored-by: Jawz84 <26464885+Jawz84@users.noreply.github.com> --- README.md | 13 +++++++------ explainpowershell.apphost/AppHost.cs | 13 +++++-------- .../appsettings.Development.json | 3 +++ .../explainpowershell.apphost.csproj | 1 - 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 3bc9326..c59aadf 100644 --- a/README.md +++ b/README.md @@ -30,17 +30,17 @@ I envision something like this: ## Development -There are two ways to run the development environment: using .NET Aspire (recommended) or the traditional manual setup. +There are two ways to run the development environment: using .NET Aspire (recommended) or the traditional manual setup. Both use the same prerequisites - no Docker required. ### Option 1: Using .NET Aspire (Recommended) -.NET Aspire provides a streamlined development experience with automatic orchestration of all services, including the Azurite storage emulator. +.NET Aspire provides a streamlined development experience with automatic orchestration of all services and a unified monitoring dashboard. **Prerequisites:** - .NET 10 SDK - PowerShell 7.4+ -- Docker (for Azurite emulation) - Azure Functions Core Tools v4 +- VS Code with the Azurite extension (`azurite.azurite`) **Getting Started:** @@ -49,15 +49,16 @@ There are two ways to run the development environment: using .NET Aspire (recomm ./bootstrap.ps1 ``` -2. Start all services with a single command: +2. Start the Azurite Table service via the VS Code Azurite extension (`Az: Start Table Service` from the Command Palette). + +3. Start all services with a single command: ```powershell dotnet run --project explainpowershell.apphost ``` -3. Open the Aspire dashboard (URL shown in console output) to monitor all services, view logs, and access the frontend. +4. Open the Aspire dashboard (URL shown in console output) to monitor all services, view logs, and access the frontend. The Aspire AppHost automatically: -- Starts the Azurite storage emulator in Docker - Launches the Azure Functions backend (analysis service) - Starts the Blazor WebAssembly frontend - Provides a unified dashboard for monitoring and debugging diff --git a/explainpowershell.apphost/AppHost.cs b/explainpowershell.apphost/AppHost.cs index b0f0450..3873e02 100644 --- a/explainpowershell.apphost/AppHost.cs +++ b/explainpowershell.apphost/AppHost.cs @@ -1,16 +1,13 @@ var builder = DistributedApplication.CreateBuilder(args); -// Configure Azure Storage emulator (Azurite) for local development -var storage = builder.AddAzureStorage("storage") - .RunAsEmulator(); - -// Add the Azure Table storage resource used by the analysis service -var tables = storage.AddTables("tables"); +// Use the VS Code Azurite extension (no Docker required) +// Start Azurite via VS Code Command Palette: "Azurite: Start Table Service" +// Connection string matches the default Azurite development storage settings +var storage = builder.AddConnectionString("AzureWebJobsStorage"); // Add the Azure Functions analysis service backend var analysisService = builder.AddAzureFunctionsProject("analysisservice") - .WithReference(tables) - .WaitFor(tables); + .WithReference(storage); // Add the Blazor WebAssembly frontend as a static web app // Note: Blazor WASM runs in the browser - the appsettings.json configures the BaseAddress diff --git a/explainpowershell.apphost/appsettings.Development.json b/explainpowershell.apphost/appsettings.Development.json index 0c208ae..e1572e6 100644 --- a/explainpowershell.apphost/appsettings.Development.json +++ b/explainpowershell.apphost/appsettings.Development.json @@ -4,5 +4,8 @@ "Default": "Information", "Microsoft.AspNetCore": "Warning" } + }, + "ConnectionStrings": { + "AzureWebJobsStorage": "UseDevelopmentStorage=true" } } diff --git a/explainpowershell.apphost/explainpowershell.apphost.csproj b/explainpowershell.apphost/explainpowershell.apphost.csproj index 6b4c494..f884b4e 100644 --- a/explainpowershell.apphost/explainpowershell.apphost.csproj +++ b/explainpowershell.apphost/explainpowershell.apphost.csproj @@ -10,7 +10,6 @@ -