Skip to content

Commit f5dcf65

Browse files
authored
Merge pull request #596 from fboucher/upgrade-packages
Updates to .NET 10 and Aspire
2 parents c934f32 + 8545f16 commit f5dcf65

16 files changed

Lines changed: 92 additions & 47 deletions

.aspire/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"appHostPath": "..\\src\\AppHost\\Cloud5mins.ShortenerTools.AppHost.csproj"
3+
}

.devcontainer/devcontainer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
33
{
4-
"name": "C# (.NET)",
4+
"name": "C# (.NET 10)",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/dotnet:1-9.0-bookworm",
6+
"image": "mcr.microsoft.com/devcontainers/dotnet:1-10.0-noble",
77
"features": {
88
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
99
"ghcr.io/devcontainers/features/dotnet:2": {},
1010
"ghcr.io/devcontainers/features/github-cli:1": {},
1111
"ghcr.io/azure/azure-dev/azd:0": {},
1212
"ghcr.io/dotnet/aspire-devcontainer-feature/dotnetaspire:1": {}
13-
}
13+
},
1414

1515
// Features to add to the dev container. More info: https://containers.dev/features.
1616
// "features": {},
@@ -24,7 +24,7 @@
2424
// }
2525

2626
// Use 'postCreateCommand' to run commands after the container is created.
27-
// "postCreateCommand": "dotnet restore",
27+
"postCreateCommand": "cd src && find . -type d -name 'obj' -o -name 'bin' | xargs rm -rf && dotnet restore"
2828

2929
// Configure tool-specific properties.
3030
// "customizations": {},

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ jobs:
2121
- name: Set up .NET
2222
uses: actions/setup-dotnet@v4
2323
with:
24-
dotnet-version: '9.0.x' # Adjust the version as needed
24+
dotnet-version: '10.0.x' # Adjust the version as needed
2525

2626
- name: Clean up previous builds
2727
run: dotnet clean src/AzUrlShortener.sln
2828

29-
- name: Install .NET Aspire workload
29+
- name: Install Aspire workload
3030
run: dotnet workload update && dotnet workload install aspire
3131

3232
- name: Restore dependencies

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Azure Url Shortener (AzUrlShortener)
22

3-
![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)
3+
![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)
44

55
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
66
[![All Contributors](https://img.shields.io/badge/all_contributors-23-orange.svg?style=flat-square)](#contributors-)

doc/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
## How to run AzUrlShortener locally
1616

17-
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.
17+
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.
1818

1919

2020
## Update/ redeploy AzUrlShortener

doc/how-to-deploy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ After a few seconds, you should now be in your version of the AzUrlShortener pro
6161

6262
1. Get the application URL
6363

64-
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.
64+
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.
6565

6666
![azd deployment result](../images/deployment-result.png)
6767

doc/security-considerations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ For more details about the built-in authentication feature of ACA, see [Authenti
1515

1616
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.
1717

18-
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.
18+
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.
1919

2020
For more details about Security read the [SECURITY.md](../SECURITY.md) file.

src/Api/Cloud5mins.ShortenerTools.Api.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
7+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
78
</PropertyGroup>
89

910
<ItemGroup>
10-
<PackageReference Include="Aspire.Azure.Data.Tables" Version="9.3.0" />
11-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.5" />
11+
<PackageReference Include="Aspire.Azure.Data.Tables" />
12+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" />
1213
</ItemGroup>
1314

1415
<ItemGroup>

src/Api/Cloud5mins.ShortenerTools.Api.http

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Content-Type: application/json
1616
{
1717
"Vanity": "1111-test",
1818
"Url": "",
19-
"Title": ".NET Aspire Azure Blob Storage integration"
19+
"Title": "Aspire Azure Blob Storage integration"
2020
}
2121

2222
### ERROR URL not valid
@@ -28,7 +28,7 @@ Content-Type: application/json
2828
{
2929
"Vanity": "1111-test",
3030
"Url": "That's not a URL",
31-
"Title": ".NET Aspire Azure Blob Storage integration"
31+
"Title": "Aspire Azure Blob Storage integration"
3232
}
3333

3434
### ####################################
@@ -41,7 +41,7 @@ Content-Type: application/json
4141
{
4242
"Vanity": "1111-test",
4343
"Url": "https://learn.microsoft.com/en-us/dotnet/aspire/storage/azure-storage-blobs-integration?tabs=dotnet-cli",
44-
"Title": ".NET Aspire Azure Blob Storage integration"
44+
"Title": "Aspire Azure Blob Storage integration"
4545
}
4646

4747
### ####################################
@@ -82,7 +82,7 @@ Content-Type: application/json
8282
"rowKey": "1111-test",
8383
"Vanity": "1111-test",
8484
"Url": "https://learn.microsoft.com/en-us/dotnet/aspire/storage/azure-storage-blobs-integration?tabs=dotnet-cli",
85-
"Title": ".NET Aspire Azure Blob Storage integration"
85+
"Title": "Aspire Azure Blob Storage integration"
8686
}
8787

8888

src/AppHost/Cloud5mins.ShortenerTools.AppHost.csproj

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
3-
<Sdk Name="Aspire.AppHost.Sdk" Version="9.3.0" />
1+
<Project Sdk="Aspire.AppHost.Sdk/13.1.0">
42

53
<PropertyGroup>
64
<OutputType>Exe</OutputType>
7-
<TargetFramework>net9.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
86
<ImplicitUsings>enable</ImplicitUsings>
97
<Nullable>enable</Nullable>
108
<IsAspireHost>true</IsAspireHost>
9+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1110
</PropertyGroup>
1211

1312
<ItemGroup>
14-
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.3.0" />
15-
<PackageReference Include="Aspire.Hosting.Azure.Functions" Version="9.3.0-preview.1.25265.20" />
16-
<PackageReference Include="Aspire.Hosting.Azure.Storage" Version="9.3.0" />
13+
<PackageReference Include="Aspire.Hosting.Azure.Functions" />
14+
<PackageReference Include="Aspire.Hosting.Azure.Storage" />
1715
</ItemGroup>
1816

1917
<ItemGroup>

0 commit comments

Comments
 (0)