Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="AzureFunctions@internalrelease" value="https://azfunc.pkgs.visualstudio.com/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/AzureFunctions%40internalrelease/nuget/v3/index.json" />
<add key="AzureFunctions@staging" value="https://azfunc.pkgs.visualstudio.com/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/AzureFunctions%40staging/nuget/v3/index.json" />
</packageSources>
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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/ "<Azure Functions Host Root>/src/WebJobs.Script.WebHost/bin/Debug/net7.0/workers/powershell/7.4"
Copy-Item -Force ./src/bin/Debug/net7.0/publish/worker.config.json "<Azure Functions Host Root>/src/WebJobs.Script.WebHost/bin/Debug/net7.0/workers/powershell"
Copy-Item -Recurse -Force ./src/bin/Debug/net8.0/publish/ "<Azure Functions Host Root>/src/WebJobs.Script.WebHost/bin/Debug/net8.0/workers/powershell/7.4"
Copy-Item -Force ./src/bin/Debug/net8.0/publish/worker.config.json "<Azure Functions Host Root>/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"`
Expand All @@ -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.
21 changes: 3 additions & 18 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the MIT license. See LICENSE file in the project root for full li
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\PowerShellWorker.Common.props" />
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<NoBuild>true</NoBuild>
<IncludeBuildOutput>false</IncludeBuildOutput>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
5 changes: 3 additions & 2 deletions src/Microsoft.Azure.Functions.PowerShellWorker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Licensed under the MIT license. See LICENSE file in the project root for full li
<Import Project="..\PowerShellWorker.Common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<TieredCompilation>true</TieredCompilation>
<Product>Azure Function PowerShell Language Worker</Product>
<AssemblyName>Microsoft.Azure.Functions.PowerShellWorker</AssemblyName>
Expand All @@ -21,10 +21,11 @@ Licensed under the MIT license. See LICENSE file in the project root for full li

<ItemGroup>
<PackageReference Include="Grpc.Net.Client" Version="2.49.0" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.0-preview.1" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.0-preview.2" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Google.Protobuf" Version="3.21.9" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.3" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.6.0-2.23152.6" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/E2E/Start-E2ETest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\PowerShellWorker.Common.props" />
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand All @@ -10,7 +10,8 @@
<PackageReference Include="Moq" Version="4.18.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.0-preview.1" />
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.0-preview.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.6.0-2.23152.6" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions tools/helper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand Down
2 changes: 1 addition & 1 deletion tools/protobuf.tools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Licensed under the MIT license. See LICENSE file in the project root for full li
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<NoBuild>true</NoBuild>
</PropertyGroup>

Expand Down