From 2869dfa44b3f6776158bf72575156939eb25e801 Mon Sep 17 00:00:00 2001 From: Francisco-Gamino Date: Mon, 17 Apr 2023 19:48:45 -0700 Subject: [PATCH 1/5] Upgrade to PowerShell SDK 7.4.0-preview.2 --- src/Microsoft.Azure.Functions.PowerShellWorker.csproj | 2 +- .../Unit/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.Azure.Functions.PowerShellWorker.csproj b/src/Microsoft.Azure.Functions.PowerShellWorker.csproj index aef8047d..82f37c69 100644 --- a/src/Microsoft.Azure.Functions.PowerShellWorker.csproj +++ b/src/Microsoft.Azure.Functions.PowerShellWorker.csproj @@ -21,7 +21,7 @@ Licensed under the MIT license. See LICENSE file in the project root for full li - + diff --git a/test/Unit/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj b/test/Unit/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj index 4c81980f..5137dd00 100644 --- a/test/Unit/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj +++ b/test/Unit/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj @@ -10,7 +10,7 @@ - + From cefe1fd68a6283ce71eff84daf45c39bd1da3606 Mon Sep 17 00:00:00 2001 From: Francisco-Gamino Date: Tue, 18 Apr 2023 11:21:06 -0700 Subject: [PATCH 2/5] Update build.ps1 script to only build the PS 7.4 worker --- build.ps1 | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/build.ps1 b/build.ps1 index a1bf0ecf..3d7615f2 100644 --- a/build.ps1 +++ b/build.ps1 @@ -34,32 +34,17 @@ param( $AddSBOM, [string] - $SBOMUtilSASUrl, - - [string] - [ValidateSet("7.2", "7.4")] - $WorkerVersion + $SBOMUtilSASUrl ) #Requires -Version 7.0 Import-Module "$PSScriptRoot/tools/helper.psm1" -Force -$PowerShellVersion = $null -$TargetFramework = $null -$DefaultPSWorkerVersion = '7.4' - -if (-not $workerVersion) -{ - Write-Log "Worker version not specified. Setting workerVersion to '$DefaultPSWorkerVersion'" - $workerVersion = $DefaultPSWorkerVersion -} +$TargetFramework = 'net8.0' +$PowerShellVersion = '7.4' -$PowerShellVersion = $WorkerVersion Write-Log "Build worker version: $PowerShellVersion" - -# Set target framework for 7.2 to net6.0 and for 7.4 to net7.0 -$TargetFramework = ($PowerShellVersion -eq "7.2") ? 'net6.0' : 'net7.0' Write-Log "Target framework: $TargetFramework" function Get-FunctionsCoreToolsDir { From cfc1aefa54c969ef6e04eacaa18b328324c5736b Mon Sep 17 00:00:00 2001 From: Francisco-Gamino Date: Tue, 18 Apr 2023 13:44:57 -0700 Subject: [PATCH 3/5] Upgrade to .NET SDK 8.0 --- README.md | 14 +++++++------- ...Azure.Functions.PowerShellWorker.Package.csproj | 2 +- ...crosoft.Azure.Functions.PowerShellWorker.csproj | 2 +- .../Azure.Functions.PowerShellWorker.E2E.csproj | 2 +- test/E2E/Start-E2ETest.ps1 | 2 +- ...ft.Azure.Functions.PowerShellWorker.Test.csproj | 2 +- tools/helper.psm1 | 6 +++--- tools/protobuf.tools.csproj | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index f4ae52fe..c457eab6 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ with any additional questions or comments. ### Prereqs -* [.NET 7.0 SDK](https://www.microsoft.com/net/download/visual-studio-sdks) +* [.NET 8.0 SDK](https://www.microsoft.com/net/download/visual-studio-sdks) ### Build @@ -84,8 +84,8 @@ On macOS if you installed via `brew` Under the `workers/powershell` folder, create a folder with the name `7.4` if it does not exist yet. Copy the result of the `publish` directory into the `workers/powershell/7.4` folder, and copy the `publish/worker.config.json` file into the `workers/powershell` folder: ```powershell -Copy-Item -Recurse -Force ./src/bin/Debug/net7.0/publish/ "/usr/local/Cellar/azure-functions-core-tools/$(func --version)/workers/powershell/7.4" -Copy-Item -Recurse -Force ./src/bin/Debug/net7.0/publish/worker.config.json "/usr/local/Cellar/azure-functions-core-tools/$(func --version)/workers/powershell" +Copy-Item -Recurse -Force ./src/bin/Debug/net8.0/publish/ "/usr/local/Cellar/azure-functions-core-tools/$(func --version)/workers/powershell/7.4" +Copy-Item -Recurse -Force ./src/bin/Debug/net8.0/publish/worker.config.json "/usr/local/Cellar/azure-functions-core-tools/$(func --version)/workers/powershell" ``` > NOTE: if the powershell folder already exists, you should delete it or debugging won't work. @@ -121,13 +121,13 @@ of your test functions app. Under the `workers/powershell` folder, create a folder with the name `7.4` if it does not exist yet. Then copy the `publish` directory to `workers/powershell/7.4`, and the `publish/worker.config.json` to `workers/powershell`: ```powershell -Copy-Item -Recurse -Force ./src/bin/Debug/net7.0/publish/ "/src/WebJobs.Script.WebHost/bin/Debug/net7.0/workers/powershell/7.4" -Copy-Item -Force ./src/bin/Debug/net7.0/publish/worker.config.json "/src/WebJobs.Script.WebHost/bin/Debug/net7.0/workers/powershell" +Copy-Item -Recurse -Force ./src/bin/Debug/net8.0/publish/ "/src/WebJobs.Script.WebHost/bin/Debug/net8.0/workers/powershell/7.4" +Copy-Item -Force ./src/bin/Debug/net8.0/publish/worker.config.json "/src/WebJobs.Script.WebHost/bin/Debug/net8.0/workers/powershell" ``` Then you can start the host by running: ```sh -dotnet ./src/WebJobs.Script.WebHost/bin/Debug/net7.0/Microsoft.Azure.WebJobs.Script.WebHost.dll +dotnet ./src/WebJobs.Script.WebHost/bin/Debug/net8.0/Microsoft.Azure.WebJobs.Script.WebHost.dll ``` > Note: Remember to remove `"AzureWebJobsScriptRoot"` @@ -149,6 +149,6 @@ That will place a `Microsoft.Azure.Functions.PowerShellWorker.*.nupkg` in: It pulls the contents of the publish folder in: -`azure-functions-powershell-worker/src/bin/Debug/net7.0/publish` +`azure-functions-powershell-worker/src/bin/Debug/net8.0/publish` if you specify a different Configuration or TargetFramework that will be honored. diff --git a/package/Microsoft.Azure.Functions.PowerShellWorker.Package.csproj b/package/Microsoft.Azure.Functions.PowerShellWorker.Package.csproj index 20149e72..5d21fdd4 100644 --- a/package/Microsoft.Azure.Functions.PowerShellWorker.Package.csproj +++ b/package/Microsoft.Azure.Functions.PowerShellWorker.Package.csproj @@ -5,7 +5,7 @@ Licensed under the MIT license. See LICENSE file in the project root for full li - net7.0 + net8.0 true false true diff --git a/src/Microsoft.Azure.Functions.PowerShellWorker.csproj b/src/Microsoft.Azure.Functions.PowerShellWorker.csproj index 82f37c69..3502aa23 100644 --- a/src/Microsoft.Azure.Functions.PowerShellWorker.csproj +++ b/src/Microsoft.Azure.Functions.PowerShellWorker.csproj @@ -6,7 +6,7 @@ Licensed under the MIT license. See LICENSE file in the project root for full li Exe - net7.0 + net8.0 true Azure Function PowerShell Language Worker Microsoft.Azure.Functions.PowerShellWorker diff --git a/test/E2E/Azure.Functions.PowerShellWorker.E2E/Azure.Functions.PowerShellWorker.E2E/Azure.Functions.PowerShellWorker.E2E.csproj b/test/E2E/Azure.Functions.PowerShellWorker.E2E/Azure.Functions.PowerShellWorker.E2E/Azure.Functions.PowerShellWorker.E2E.csproj index 0810259f..b6079361 100644 --- a/test/E2E/Azure.Functions.PowerShellWorker.E2E/Azure.Functions.PowerShellWorker.E2E/Azure.Functions.PowerShellWorker.E2E.csproj +++ b/test/E2E/Azure.Functions.PowerShellWorker.E2E/Azure.Functions.PowerShellWorker.E2E/Azure.Functions.PowerShellWorker.E2E.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/test/E2E/Start-E2ETest.ps1 b/test/E2E/Start-E2ETest.ps1 index 712a1278..24e6ff42 100644 --- a/test/E2E/Start-E2ETest.ps1 +++ b/test/E2E/Start-E2ETest.ps1 @@ -58,7 +58,7 @@ function NewTaskHubName $taskHubName = NewTaskHubName -Length 45 $FUNC_RUNTIME_VERSION = '4' -$TARGET_FRAMEWORK = 'net7.0' +$TARGET_FRAMEWORK = 'net8.0' $POWERSHELL_VERSION = '7.4' $arch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant() diff --git a/test/Unit/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj b/test/Unit/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj index 5137dd00..6494bea7 100644 --- a/test/Unit/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj +++ b/test/Unit/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false diff --git a/tools/helper.psm1 b/tools/helper.psm1 index 75fbc59c..47d9e28b 100644 --- a/tools/helper.psm1 +++ b/tools/helper.psm1 @@ -16,9 +16,9 @@ $DotnetSDKVersionRequirements = @{ DefaultPatch = '426' } - '7.0' = @{ - MinimalPatch = '101' - DefaultPatch = '101' + '8.0' = @{ + MinimalPatch = '100-preview.3.23178.7' + DefaultPatch = '100-preview.3.23178.7' } } diff --git a/tools/protobuf.tools.csproj b/tools/protobuf.tools.csproj index 45ea8d60..b1c0658e 100644 --- a/tools/protobuf.tools.csproj +++ b/tools/protobuf.tools.csproj @@ -6,7 +6,7 @@ Licensed under the MIT license. See LICENSE file in the project root for full li - net7.0 + net8.0 true From e734524c9ecd318e93b2916da53759bb726ef0c2 Mon Sep 17 00:00:00 2001 From: Francisco-Gamino Date: Tue, 18 Apr 2023 22:47:11 -0700 Subject: [PATCH 4/5] Add dotnet tools feed --- NuGet.config | 1 + 1 file changed, 1 insertion(+) diff --git a/NuGet.config b/NuGet.config index 4538c7d8..c5e88ec3 100644 --- a/NuGet.config +++ b/NuGet.config @@ -2,6 +2,7 @@ + From 07c6e926e4589358dc656245d97ac812118eed88 Mon Sep 17 00:00:00 2001 From: Francisco-Gamino Date: Tue, 18 Apr 2023 22:48:44 -0700 Subject: [PATCH 5/5] Add PowerShell SDK 7.4.0-preview.2 dependency --- src/Microsoft.Azure.Functions.PowerShellWorker.csproj | 1 + test/Unit/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Microsoft.Azure.Functions.PowerShellWorker.csproj b/src/Microsoft.Azure.Functions.PowerShellWorker.csproj index 3502aa23..20267a2d 100644 --- a/src/Microsoft.Azure.Functions.PowerShellWorker.csproj +++ b/src/Microsoft.Azure.Functions.PowerShellWorker.csproj @@ -25,6 +25,7 @@ Licensed under the MIT license. See LICENSE file in the project root for full li + diff --git a/test/Unit/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj b/test/Unit/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj index 6494bea7..b96085c2 100644 --- a/test/Unit/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj +++ b/test/Unit/Microsoft.Azure.Functions.PowerShellWorker.Test.csproj @@ -11,6 +11,7 @@ +