Skip to content

Commit c2663e3

Browse files
dpaquetteDavid Paquette
andauthored
Update function app to .NET 6 (#139)
* Update function app to .NET 6 * Update github workflows for branch name and .net version Co-authored-by: David Paquette <dave.paquette@outlook.com>
1 parent 10f76fa commit c2663e3

File tree

4 files changed

+23
-26
lines changed

4 files changed

+23
-26
lines changed

.github/workflows/admin.yaml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ on:
77
- '2wr-app/public/images/**'
88
- 'TwoWeeksReady.Common/**'
99
- '.github/workflows/admin.yaml'
10-
branches: [ master ]
10+
branches: [ main ]
1111
pull_request:
1212
paths:
1313
- 'admin/**'
1414
- '2wr-app/public/images/**'
1515
- '.github/workflows/admin.yaml'
16-
branches: [ master ]
16+
branches: [ main ]
1717
workflow_dispatch:
1818
jobs:
1919
build:
@@ -23,11 +23,7 @@ jobs:
2323
- name: Setup .NET Core
2424
uses: actions/setup-dotnet@v1
2525
with:
26-
dotnet-version: 3.1.x
27-
- name: Setup .NET 5
28-
uses: actions/setup-dotnet@v1
29-
with:
30-
dotnet-version: 5.0.x
26+
dotnet-version: 6.0.x
3127
- name: Build
3228
run: dotnet build -c Release
3329
working-directory: ./admin
@@ -36,12 +32,12 @@ jobs:
3632
working-directory: ./admin
3733
- name: Zip Functions Package
3834
run: zip -r ../deploy.zip ./
39-
working-directory: ./admin/TwoWeeksReady.Admin/bin/Release/net5.0/publish/
35+
working-directory: ./admin/TwoWeeksReady.Admin/bin/Release/net6.0/publish/
4036
- name: Upload Deployment Zip
4137
uses: actions/upload-artifact@v2
4238
with:
4339
name: deployment_zip
44-
path: ./admin/TwoWeeksReady.Admin/bin/Release/net5.0/deploy.zip
40+
path: ./admin/TwoWeeksReady.Admin/bin/Release/net6.0/deploy.zip
4541
- name: Upload Deployment Script
4642
uses: actions/upload-artifact@v2
4743
with:

.github/workflows/api.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ on:
66
- 'api/**'
77
- 'TwoWeeksReady.Common/**'
88
- '.github/workflows/api.yaml'
9-
branches: [ master ]
9+
branches: [ main ]
1010
pull_request:
1111
paths:
1212
- 'api/**'
1313
- '.github/workflows/api.yaml'
14-
branches: [ master ]
14+
branches: [ main ]
1515
workflow_dispatch:
1616
jobs:
1717
build:
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup .NET Core
2222
uses: actions/setup-dotnet@v1
2323
with:
24-
dotnet-version: 3.1.x
24+
dotnet-version: 6.0.x
2525
- name: Build
2626
run: dotnet build -c Release
2727
working-directory: ./api
@@ -30,12 +30,12 @@ jobs:
3030
working-directory: ./api
3131
- name: Zip Functions Package
3232
run: zip -r ../deploy.zip ./
33-
working-directory: ./api/TwoWeeksReady/bin/Release/netcoreapp3.1/publish/
33+
working-directory: ./api/TwoWeeksReady/bin/Release/net6.0/publish/
3434
- name: Upload Deployment Zip
3535
uses: actions/upload-artifact@v2
3636
with:
3737
name: deployment_zip
38-
path: ./api/TwoWeeksReady/bin/Release/netcoreapp3.1/deploy.zip
38+
path: ./api/TwoWeeksReady/bin/Release/net6.0/deploy.zip
3939
- name: Upload Deployment Script
4040
uses: actions/upload-artifact@v2
4141
with:

api/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
## Prerequisites
66

7-
[.NET Core SDK 3.1](https://dotnet.microsoft.com/download)
7+
[.NET SDK 6.0](https://dotnet.microsoft.com/download)
88

9-
[Azure Functions Core Tools 3](https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=windows%2Ccsharp%2Cbash#install-the-azure-functions-core-tools)
9+
[Azure Functions Core Tools 4](https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=windows%2Ccsharp%2Cbash#install-the-azure-functions-core-tools)
1010

11-
`npm i -g azure-functions-core-tools@3 --unsafe-perm true`
11+
`npm i -g azure-functions-core-tools@4 --unsafe-perm true`
1212

1313
### Using VS Code
1414

@@ -24,11 +24,11 @@ Alternatively, there is an Azurite VS Code Extension:
2424

2525
[Install Azure Extension](https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite#install-and-run-the-azurite-visual-studio-code-extension)
2626

27-
### Using Visual Studio 2019
27+
### Using Visual Studio 2022
2828

29-
Open the `api.sln` in Visual Studio 2019.
29+
Open the `api.sln` in Visual Studio 2022.
3030

31-
You will also need the Azure Storage Emulator if using Visual Studio 2019 (if you're using VS Code, look above).
31+
You will also need the Azure Storage Emulator if using Visual Studio 2022 (if you're using VS Code, look above).
3232

3333
[Install Azure Storage Emulator](https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator?toc=/azure/storage/blobs/toc.json#get-the-storage-emulator)
3434

@@ -64,6 +64,7 @@ Create a `local.settings.json` file in the TwoWeeksReady project folder. You wil
6464
{
6565
"IsEncrypted": false,
6666
"Values": {
67+
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
6768
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
6869
"OidcApiAuthSettings:Audience": "https://2wrdev.azurewebsites.net",
6970
"OidcApiAuthSettings:IssuerUrl": "https://login.2wr.org/"

api/TwoWeeksReady/TwoWeeksReady.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp3.1</TargetFramework>
4-
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
3+
<TargetFramework>net6.0</TargetFramework>
4+
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
55
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="Azure.Storage.Blobs" Version="12.8.3" />
9-
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.10" />
10-
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.CosmosDB" Version="3.0.7" />
11-
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.9" />
8+
<PackageReference Include="Azure.Storage.Blobs" Version="12.10.0" />
9+
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="5.0.0" />
10+
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.CosmosDB" Version="3.0.10" />
11+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.0" />
1212
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
1313
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
1414
<PackageReference Include="AzureFunctions.OidcAuthentication" Version="1.0.4" />

0 commit comments

Comments
 (0)