From 3d1a3d3699c856d80bee22335d3a4b2c7308d776 Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 11 Jan 2026 14:37:50 -0500 Subject: [PATCH 1/4] feat: Upgrades to .NET 10 and central package management Migrates the project to .NET 10 and implements central package management using Directory.Packages.props. This change streamlines dependency management and ensures consistent package versions across the solution. --- .aspire/settings.json | 3 ++ src/Api/Cloud5mins.ShortenerTools.Api.csproj | 7 ++-- .../Cloud5mins.ShortenerTools.AppHost.csproj | 9 +++-- .../Cloud5mins.ShortenerTools.Core.csproj | 11 ++--- src/Directory.Packages.props | 40 +++++++++++++++++++ ...5mins.ShortenerTools.FunctionsLight.csproj | 11 ++--- ...mins.ShortenerTools.ServiceDefaults.csproj | 17 ++++---- ...mins.ShortenerTools.TinyBlazorAdmin.csproj | 9 +++-- 8 files changed, 78 insertions(+), 29 deletions(-) create mode 100644 .aspire/settings.json create mode 100644 src/Directory.Packages.props diff --git a/.aspire/settings.json b/.aspire/settings.json new file mode 100644 index 00000000..ff712e72 --- /dev/null +++ b/.aspire/settings.json @@ -0,0 +1,3 @@ +{ + "appHostPath": "..\\src\\AppHost\\Cloud5mins.ShortenerTools.AppHost.csproj" +} \ No newline at end of file diff --git a/src/Api/Cloud5mins.ShortenerTools.Api.csproj b/src/Api/Cloud5mins.ShortenerTools.Api.csproj index 72f6e810..19e21d56 100644 --- a/src/Api/Cloud5mins.ShortenerTools.Api.csproj +++ b/src/Api/Cloud5mins.ShortenerTools.Api.csproj @@ -1,14 +1,15 @@ - net9.0 + net10.0 enable enable + true - - + + diff --git a/src/AppHost/Cloud5mins.ShortenerTools.AppHost.csproj b/src/AppHost/Cloud5mins.ShortenerTools.AppHost.csproj index af13af0c..6008cc6c 100644 --- a/src/AppHost/Cloud5mins.ShortenerTools.AppHost.csproj +++ b/src/AppHost/Cloud5mins.ShortenerTools.AppHost.csproj @@ -4,16 +4,17 @@ Exe - net9.0 + net10.0 enable enable true + true - - - + + + diff --git a/src/Core/Cloud5mins.ShortenerTools.Core.csproj b/src/Core/Cloud5mins.ShortenerTools.Core.csproj index 20511850..240193c4 100644 --- a/src/Core/Cloud5mins.ShortenerTools.Core.csproj +++ b/src/Core/Cloud5mins.ShortenerTools.Core.csproj @@ -1,14 +1,15 @@ - net9.0 + net10.0 enable enable + true - - - + + + - + \ No newline at end of file diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props new file mode 100644 index 00000000..fbdd33c1 --- /dev/null +++ b/src/Directory.Packages.props @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/FunctionsLight/Cloud5mins.ShortenerTools.FunctionsLight.csproj b/src/FunctionsLight/Cloud5mins.ShortenerTools.FunctionsLight.csproj index d93ee274..d6e1e138 100644 --- a/src/FunctionsLight/Cloud5mins.ShortenerTools.FunctionsLight.csproj +++ b/src/FunctionsLight/Cloud5mins.ShortenerTools.FunctionsLight.csproj @@ -1,20 +1,21 @@ - net9.0 + net10.0 v4 Exe enable enable + true - - - - + + + + diff --git a/src/ServiceDefaults/Cloud5mins.ShortenerTools.ServiceDefaults.csproj b/src/ServiceDefaults/Cloud5mins.ShortenerTools.ServiceDefaults.csproj index 07608ebb..7fd3dd22 100644 --- a/src/ServiceDefaults/Cloud5mins.ShortenerTools.ServiceDefaults.csproj +++ b/src/ServiceDefaults/Cloud5mins.ShortenerTools.ServiceDefaults.csproj @@ -1,22 +1,23 @@ - net9.0 + net10.0 enable enable true + true - - - - - - - + + + + + + + diff --git a/src/TinyBlazorAdmin/Cloud5mins.ShortenerTools.TinyBlazorAdmin.csproj b/src/TinyBlazorAdmin/Cloud5mins.ShortenerTools.TinyBlazorAdmin.csproj index 5d4f880c..25d231f4 100644 --- a/src/TinyBlazorAdmin/Cloud5mins.ShortenerTools.TinyBlazorAdmin.csproj +++ b/src/TinyBlazorAdmin/Cloud5mins.ShortenerTools.TinyBlazorAdmin.csproj @@ -1,15 +1,16 @@ - net9.0 + net10.0 enable enable + true - - - + + + From be624c7c126d8408abbf33478516130bfa730b3c Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 11 Jan 2026 14:46:55 -0500 Subject: [PATCH 2/4] feat: Updates Aspire AppHost SDK Updates the Aspire AppHost SDK to version 13.1.0. Removes redundant package references. --- src/AppHost/Cloud5mins.ShortenerTools.AppHost.csproj | 5 +---- src/Directory.Packages.props | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/AppHost/Cloud5mins.ShortenerTools.AppHost.csproj b/src/AppHost/Cloud5mins.ShortenerTools.AppHost.csproj index 6008cc6c..0f8183cf 100644 --- a/src/AppHost/Cloud5mins.ShortenerTools.AppHost.csproj +++ b/src/AppHost/Cloud5mins.ShortenerTools.AppHost.csproj @@ -1,6 +1,4 @@ - - - + Exe @@ -12,7 +10,6 @@ - diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index fbdd33c1..b23f817d 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -4,7 +4,6 @@ - From cd45c7ead0aa250b66963b150be38369642e5617 Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 11 Jan 2026 14:55:00 -0500 Subject: [PATCH 3/4] Updates to .NET 10 and Aspire in ReadMe, dockerfile, workflows Updates the project to use .NET 10.0 and removes the redundant ".NET" prefix when refering to Aspire. This ensures the project is running on the latest version of the .NET runtime and improves clarity in documentation and examples. --- .devcontainer/devcontainer.json | 2 +- .github/workflows/build.yml | 4 ++-- README.md | 2 +- doc/faq.md | 2 +- doc/how-to-deploy.md | 2 +- doc/security-considerations.md | 2 +- src/Api/Cloud5mins.ShortenerTools.Api.http | 8 ++++---- src/ServiceDefaults/Extensions.cs | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5415ef28..d6bcbf99 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ { "name": "C# (.NET)", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/dotnet:1-9.0-bookworm", + "image": "mcr.microsoft.com/devcontainers/dotnet:1-10.0-bookworm", "features": { "ghcr.io/devcontainers/features/docker-in-docker:2": {}, "ghcr.io/devcontainers/features/dotnet:2": {}, diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 02c3fbbb..26e692b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,12 +21,12 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: '9.0.x' # Adjust the version as needed + dotnet-version: '10.0.x' # Adjust the version as needed - name: Clean up previous builds run: dotnet clean src/AzUrlShortener.sln - - name: Install .NET Aspire workload + - name: Install Aspire workload run: dotnet workload update && dotnet workload install aspire - name: Restore dependencies diff --git a/README.md b/README.md index 1839ed3a..e0e3bcf6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Azure Url Shortener (AzUrlShortener) -![GitHub Release](https://img.shields.io/github/v/release/microsoft/AzUrlShortener) ![.NET](https://img.shields.io/badge/9.0-512BD4?logo=dotnet&logoColor=fff) [![Build](https://github.com/microsoft/AzUrlShortener/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/microsoft/AzUrlShortener/actions/workflows/build.yml) ![GitHub License](https://img.shields.io/github/license/microsoft/AzUrlShortener) [![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?&logo=discord&logoColor=white)](https://discord.gg/6zA3jKw) +![GitHub Release](https://img.shields.io/github/v/release/microsoft/AzUrlShortener) ![.NET](https://img.shields.io/badge/10.0-512BD4?logo=dotnet&logoColor=fff) [![Build](https://github.com/microsoft/AzUrlShortener/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/microsoft/AzUrlShortener/actions/workflows/build.yml) ![GitHub License](https://img.shields.io/github/license/microsoft/AzUrlShortener) [![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?&logo=discord&logoColor=white)](https://discord.gg/6zA3jKw) [![All Contributors](https://img.shields.io/badge/all_contributors-23-orange.svg?style=flat-square)](#contributors-) diff --git a/doc/faq.md b/doc/faq.md index 10102834..efd319d5 100644 --- a/doc/faq.md +++ b/doc/faq.md @@ -14,7 +14,7 @@ ## How to run AzUrlShortener locally -You will need .NET 9, Docker or Podman installed on your machine. From the `scr` directory, run the following command `dotnet run --project AppHost`. You can also open the solution in Visual Studio or Visual studio Code and use F5, make sure the `Cloud5mins.ShortenerTools.AppHost` project is set as starting project. +You will need .NET 10, Docker or Podman installed on your machine. From the `scr` directory, run the following command `dotnet run --project AppHost`. You can also open the solution in Visual Studio or Visual studio Code and use F5, make sure the `Cloud5mins.ShortenerTools.AppHost` project is set as starting project. ## Update/ redeploy AzUrlShortener diff --git a/doc/how-to-deploy.md b/doc/how-to-deploy.md index fea2a668..8309e9a7 100644 --- a/doc/how-to-deploy.md +++ b/doc/how-to-deploy.md @@ -61,7 +61,7 @@ After a few seconds, you should now be in your version of the AzUrlShortener pro 1. Get the application URL -After the deployment is complete, you will see the URLs of your applications in the terminal; the one starting by `https://admin` is the admin tools (aka TinyBlazorAdmin), and the one starting with `https://azfunc-light` is the redicrect service. There is also many details about the resources created in Azure, and a link to the .NET Aspire dashboard. +After the deployment is complete, you will see the URLs of your applications in the terminal; the one starting by `https://admin` is the admin tools (aka TinyBlazorAdmin), and the one starting with `https://azfunc-light` is the redicrect service. There is also many details about the resources created in Azure, and a link to the Aspire dashboard. ![azd deployment result](../images/deployment-result.png) diff --git a/doc/security-considerations.md b/doc/security-considerations.md index 724c47b4..67818251 100644 --- a/doc/security-considerations.md +++ b/doc/security-considerations.md @@ -15,6 +15,6 @@ For more details about the built-in authentication feature of ACA, see [Authenti Using Azure Container Apps (ACA), the API container will only be accessible from the TinyBlazorAdmin and won't be exposed to the Internet. As a bonus, since TinyBlazorAdmin and the API are now running inside containers, you could also decide to run them locally. -The storage access got also a security upgrade. Instead of using a connection string, I will be using a Managed Identity to access the Azure Storage Table. This is a much more secure way to access Azure resources, and thanks to .NET Aspire, it is also very easy to implement. +The storage access got also a security upgrade. Instead of using a connection string, I will be using a Managed Identity to access the Azure Storage Table. This is a much more secure way to access Azure resources, and thanks to Aspire, it is also very easy to implement. For more details about Security read the [SECURITY.md](../SECURITY.md) file. \ No newline at end of file diff --git a/src/Api/Cloud5mins.ShortenerTools.Api.http b/src/Api/Cloud5mins.ShortenerTools.Api.http index c928e323..5404bb6d 100644 --- a/src/Api/Cloud5mins.ShortenerTools.Api.http +++ b/src/Api/Cloud5mins.ShortenerTools.Api.http @@ -16,7 +16,7 @@ Content-Type: application/json { "Vanity": "1111-test", "Url": "", - "Title": ".NET Aspire Azure Blob Storage integration" + "Title": "Aspire Azure Blob Storage integration" } ### ERROR URL not valid @@ -28,7 +28,7 @@ Content-Type: application/json { "Vanity": "1111-test", "Url": "That's not a URL", - "Title": ".NET Aspire Azure Blob Storage integration" + "Title": "Aspire Azure Blob Storage integration" } ### #################################### @@ -41,7 +41,7 @@ Content-Type: application/json { "Vanity": "1111-test", "Url": "https://learn.microsoft.com/en-us/dotnet/aspire/storage/azure-storage-blobs-integration?tabs=dotnet-cli", - "Title": ".NET Aspire Azure Blob Storage integration" + "Title": "Aspire Azure Blob Storage integration" } ### #################################### @@ -82,7 +82,7 @@ Content-Type: application/json "rowKey": "1111-test", "Vanity": "1111-test", "Url": "https://learn.microsoft.com/en-us/dotnet/aspire/storage/azure-storage-blobs-integration?tabs=dotnet-cli", - "Title": ".NET Aspire Azure Blob Storage integration" + "Title": "Aspire Azure Blob Storage integration" } diff --git a/src/ServiceDefaults/Extensions.cs b/src/ServiceDefaults/Extensions.cs index 2a3f4e07..44ecc6cc 100644 --- a/src/ServiceDefaults/Extensions.cs +++ b/src/ServiceDefaults/Extensions.cs @@ -10,7 +10,7 @@ namespace Microsoft.Extensions.Hosting; -// Adds common .NET Aspire services: service discovery, resilience, health checks, and OpenTelemetry. +// 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 From 8545f16bb5cea1a7a628bad64de883022c9940fd Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 11 Jan 2026 15:25:58 -0500 Subject: [PATCH 4/4] Upgrades .NET devcontainer to noble and cleans obj/bin Updates the .NET devcontainer image to use the noble distribution. Adds a post-create command to clean up obj and bin directories and restore dotnet dependencies, ensuring a clean build environment. --- .devcontainer/devcontainer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d6bcbf99..8e786199 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,16 +1,16 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/dotnet { - "name": "C# (.NET)", + "name": "C# (.NET 10)", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/dotnet:1-10.0-bookworm", + "image": "mcr.microsoft.com/devcontainers/dotnet:1-10.0-noble", "features": { "ghcr.io/devcontainers/features/docker-in-docker:2": {}, "ghcr.io/devcontainers/features/dotnet:2": {}, "ghcr.io/devcontainers/features/github-cli:1": {}, "ghcr.io/azure/azure-dev/azd:0": {}, "ghcr.io/dotnet/aspire-devcontainer-feature/dotnetaspire:1": {} - } + }, // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, @@ -24,7 +24,7 @@ // } // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "dotnet restore", + "postCreateCommand": "cd src && find . -type d -name 'obj' -o -name 'bin' | xargs rm -rf && dotnet restore" // Configure tool-specific properties. // "customizations": {},