From a78f83da84cd627485f4f51aba1abfc42c99ba49 Mon Sep 17 00:00:00 2001 From: David Paquette Date: Sat, 5 Mar 2022 08:42:08 -0700 Subject: [PATCH 1/2] Update function app to .NET 6 --- api/README.md | 13 +++++++------ api/TwoWeeksReady/TwoWeeksReady.csproj | 12 ++++++------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/api/README.md b/api/README.md index d52e557..5f4d106 100644 --- a/api/README.md +++ b/api/README.md @@ -4,11 +4,11 @@ ## Prerequisites -[.NET Core SDK 3.1](https://dotnet.microsoft.com/download) +[.NET SDK 6.0](https://dotnet.microsoft.com/download) -[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) +[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) - `npm i -g azure-functions-core-tools@3 --unsafe-perm true` + `npm i -g azure-functions-core-tools@4 --unsafe-perm true` ### Using VS Code @@ -24,11 +24,11 @@ Alternatively, there is an Azurite VS Code Extension: [Install Azure Extension](https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite#install-and-run-the-azurite-visual-studio-code-extension) -### Using Visual Studio 2019 +### Using Visual Studio 2022 -Open the `api.sln` in Visual Studio 2019. +Open the `api.sln` in Visual Studio 2022. -You will also need the Azure Storage Emulator if using Visual Studio 2019 (if you're using VS Code, look above). +You will also need the Azure Storage Emulator if using Visual Studio 2022 (if you're using VS Code, look above). [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) @@ -64,6 +64,7 @@ Create a `local.settings.json` file in the TwoWeeksReady project folder. You wil { "IsEncrypted": false, "Values": { + "AzureWebJobsStorage": "UseDevelopmentStorage=true", "FUNCTIONS_WORKER_RUNTIME": "dotnet", "OidcApiAuthSettings:Audience": "https://2wrdev.azurewebsites.net", "OidcApiAuthSettings:IssuerUrl": "https://login.2wr.org/" diff --git a/api/TwoWeeksReady/TwoWeeksReady.csproj b/api/TwoWeeksReady/TwoWeeksReady.csproj index e910129..f6d7c40 100644 --- a/api/TwoWeeksReady/TwoWeeksReady.csproj +++ b/api/TwoWeeksReady/TwoWeeksReady.csproj @@ -1,14 +1,14 @@ - netcoreapp3.1 - v3 + net6.0 + v4 <_FunctionsSkipCleanOutput>true - - - - + + + + From b019efb6f61096bf9bd53e76488d936c23c0c2bc Mon Sep 17 00:00:00 2001 From: David Paquette Date: Sat, 5 Mar 2022 08:50:03 -0700 Subject: [PATCH 2/2] Update github workflows for branch name and .net version --- .github/workflows/admin.yaml | 14 +++++--------- .github/workflows/api.yaml | 10 +++++----- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/admin.yaml b/.github/workflows/admin.yaml index 28c9fae..eb1c561 100644 --- a/.github/workflows/admin.yaml +++ b/.github/workflows/admin.yaml @@ -7,13 +7,13 @@ on: - '2wr-app/public/images/**' - 'TwoWeeksReady.Common/**' - '.github/workflows/admin.yaml' - branches: [ master ] + branches: [ main ] pull_request: paths: - 'admin/**' - '2wr-app/public/images/**' - '.github/workflows/admin.yaml' - branches: [ master ] + branches: [ main ] workflow_dispatch: jobs: build: @@ -23,11 +23,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.x - - name: Setup .NET 5 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 5.0.x + dotnet-version: 6.0.x - name: Build run: dotnet build -c Release working-directory: ./admin @@ -36,12 +32,12 @@ jobs: working-directory: ./admin - name: Zip Functions Package run: zip -r ../deploy.zip ./ - working-directory: ./admin/TwoWeeksReady.Admin/bin/Release/net5.0/publish/ + working-directory: ./admin/TwoWeeksReady.Admin/bin/Release/net6.0/publish/ - name: Upload Deployment Zip uses: actions/upload-artifact@v2 with: name: deployment_zip - path: ./admin/TwoWeeksReady.Admin/bin/Release/net5.0/deploy.zip + path: ./admin/TwoWeeksReady.Admin/bin/Release/net6.0/deploy.zip - name: Upload Deployment Script uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/api.yaml b/.github/workflows/api.yaml index 2d69bd8..b5593e7 100644 --- a/.github/workflows/api.yaml +++ b/.github/workflows/api.yaml @@ -6,12 +6,12 @@ on: - 'api/**' - 'TwoWeeksReady.Common/**' - '.github/workflows/api.yaml' - branches: [ master ] + branches: [ main ] pull_request: paths: - 'api/**' - '.github/workflows/api.yaml' - branches: [ master ] + branches: [ main ] workflow_dispatch: jobs: build: @@ -21,7 +21,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 3.1.x + dotnet-version: 6.0.x - name: Build run: dotnet build -c Release working-directory: ./api @@ -30,12 +30,12 @@ jobs: working-directory: ./api - name: Zip Functions Package run: zip -r ../deploy.zip ./ - working-directory: ./api/TwoWeeksReady/bin/Release/netcoreapp3.1/publish/ + working-directory: ./api/TwoWeeksReady/bin/Release/net6.0/publish/ - name: Upload Deployment Zip uses: actions/upload-artifact@v2 with: name: deployment_zip - path: ./api/TwoWeeksReady/bin/Release/netcoreapp3.1/deploy.zip + path: ./api/TwoWeeksReady/bin/Release/net6.0/deploy.zip - name: Upload Deployment Script uses: actions/upload-artifact@v2 with: