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/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5415ef28..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-9.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": {}, 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.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/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/AppHost/Cloud5mins.ShortenerTools.AppHost.csproj b/src/AppHost/Cloud5mins.ShortenerTools.AppHost.csproj index af13af0c..0f8183cf 100644 --- a/src/AppHost/Cloud5mins.ShortenerTools.AppHost.csproj +++ b/src/AppHost/Cloud5mins.ShortenerTools.AppHost.csproj @@ -1,19 +1,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..b23f817d --- /dev/null +++ b/src/Directory.Packages.props @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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/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 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 - - - + + +