From 6b04c2b5ec52f0e0568704d7eb83b71072562393 Mon Sep 17 00:00:00 2001 From: martincostello Date: Wed, 16 Oct 2024 12:47:24 +0100 Subject: [PATCH] Update to .NET Aspire 9 RC1 - Update to RC1 of .NET Aspire 9. - Resolve TODOs for the Cosmos emulator. --- .github/workflows/build.yml | 4 ---- Directory.Packages.props | 14 +++++++------- README.md | 5 ----- global.json | 3 +++ .../LondonTravel.Site.AppHost.csproj | 1 + src/LondonTravel.Site.AppHost/Program.cs | 10 +++++----- 6 files changed, 16 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46acc610f..084ccfd2d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -99,10 +99,6 @@ jobs: ~/.cache/ms-playwright ~/Library/Caches/ms-playwright - - name: Install .NET Workloads - shell: pwsh - run: dotnet workload restore --skip-manifest-update - - name: Build, test and publish id: build shell: pwsh diff --git a/Directory.Packages.props b/Directory.Packages.props index dd7058dad..f7492f7c0 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,13 +4,13 @@ - - - - - - - + + + + + + + diff --git a/README.md b/README.md index 7e05b1f2f..31d766f9b 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,6 @@ To build and test the website run the following commands from your terminal of c ```powershell git clone https://github.com/martincostello/alexa-london-travel-site.git cd alexa-london-travel-site - -# Restore Aspire workload on first usage (requires elevation on Windows if not installed) -dotnet workload restore - -# Build and test the application ./build.ps1 ``` diff --git a/global.json b/global.json index 6b97ddb75..7ece5613e 100644 --- a/global.json +++ b/global.json @@ -3,5 +3,8 @@ "version": "9.0.100-rc.2.24474.11", "allowPrerelease": false, "rollForward": "latestMajor" + }, + "msbuild-sdks": { + "Aspire.AppHost.Sdk": "9.0.0-rc.1.24511.1" } } diff --git a/src/LondonTravel.Site.AppHost/LondonTravel.Site.AppHost.csproj b/src/LondonTravel.Site.AppHost/LondonTravel.Site.AppHost.csproj index 33c0719f6..fe0bd2978 100644 --- a/src/LondonTravel.Site.AppHost/LondonTravel.Site.AppHost.csproj +++ b/src/LondonTravel.Site.AppHost/LondonTravel.Site.AppHost.csproj @@ -1,4 +1,5 @@ + true Exe diff --git a/src/LondonTravel.Site.AppHost/Program.cs b/src/LondonTravel.Site.AppHost/Program.cs index fe4f5f069..1b43f42c6 100644 --- a/src/LondonTravel.Site.AppHost/Program.cs +++ b/src/LondonTravel.Site.AppHost/Program.cs @@ -15,10 +15,8 @@ var cosmos = builder.AddAzureCosmosDB(Cosmos) .RunAsEmulator((container) => { - // TODO Update persistence configuration when https://github.com/dotnet/aspire/issues/3295 released - container.WithEnvironment("AZURE_COSMOS_EMULATOR_PARTITION_COUNT", "1") - .WithEnvironment("AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE", "true") - .WithVolume("londontravel-cosmosdb", "/tmp/cosmos/appdata"); + container.WithDataVolume("londontravel-cosmosdb") + .WithPartitionCount(1); }) .AddDatabase("LondonTravel"); @@ -29,7 +27,9 @@ builder.AddProject("LondonTravelSite") .WithReference(blobs) .WithReference(cosmos) - .WithReference(secrets); + .WithReference(secrets) + .WaitFor(blobs) + .WaitFor(cosmos); var app = builder.Build();