diff --git a/eng/build/Packages.props b/eng/build/Packages.props
index cef51e7d8..47b350cd2 100644
--- a/eng/build/Packages.props
+++ b/eng/build/Packages.props
@@ -3,44 +3,44 @@
-
+
-
+
+
+
-
-
+
+
-
+
-
+
-
-
-
-
+
-
-
+
+
+
-
+
diff --git a/eng/ci/templates/jobs/test-e2e-linux.yml b/eng/ci/templates/jobs/test-e2e-linux.yml
index 91e6d333f..c8c30e4c3 100644
--- a/eng/ci/templates/jobs/test-e2e-linux.yml
+++ b/eng/ci/templates/jobs/test-e2e-linux.yml
@@ -42,7 +42,7 @@ jobs:
- pwsh: |
dotnet publish src/Cli/func/Azure.Functions.Cli.csproj `
-c Release `
- -f net8.0 `
+ -f net10.0 `
-r $(runtime) `
--self-contained `
-o $(Build.ArtifactStagingDirectory)/artifacts/$(runtime)
diff --git a/eng/ci/templates/jobs/test-e2e-osx.yml b/eng/ci/templates/jobs/test-e2e-osx.yml
index f9f3df493..cf2e148d8 100644
--- a/eng/ci/templates/jobs/test-e2e-osx.yml
+++ b/eng/ci/templates/jobs/test-e2e-osx.yml
@@ -47,7 +47,7 @@ jobs:
- pwsh: |
dotnet publish src/Cli/func/Azure.Functions.Cli.csproj `
-c Release `
- -f net8.0 `
+ -f net10.0 `
-r $(runtime) `
--self-contained `
-o $(Build.ArtifactStagingDirectory)/artifacts/$(runtime)
diff --git a/eng/ci/templates/jobs/test-e2e-windows.yml b/eng/ci/templates/jobs/test-e2e-windows.yml
index badff71bc..85fb95de5 100644
--- a/eng/ci/templates/jobs/test-e2e-windows.yml
+++ b/eng/ci/templates/jobs/test-e2e-windows.yml
@@ -37,7 +37,7 @@ jobs:
- pwsh: |
dotnet publish src/Cli/func/Azure.Functions.Cli.csproj `
-c Release `
- -f net8.0 `
+ -f net10.0 `
-r $(runtime) `
--self-contained `
-o $(Build.ArtifactStagingDirectory)/artifacts/$(runtime)
diff --git a/eng/ci/templates/official/jobs/pack-cli.yml b/eng/ci/templates/official/jobs/pack-cli.yml
index dcada16ee..c5386943e 100644
--- a/eng/ci/templates/official/jobs/pack-cli.yml
+++ b/eng/ci/templates/official/jobs/pack-cli.yml
@@ -18,7 +18,7 @@ jobs:
- pwsh: |
dotnet build src/Cli/func/Azure.Functions.Cli.csproj `
-c Release `
- -f net8.0 `
+ -f net10.0 `
--no-restore `
/p:NoWorkers="true" `
/p:SkipTemplates="true" `
diff --git a/eng/ci/templates/official/jobs/publish-cli.yml b/eng/ci/templates/official/jobs/publish-cli.yml
index 168db3a87..a72bce324 100644
--- a/eng/ci/templates/official/jobs/publish-cli.yml
+++ b/eng/ci/templates/official/jobs/publish-cli.yml
@@ -33,7 +33,7 @@ jobs:
dotnet publish src/Cli/func/Azure.Functions.Cli.csproj `
-o "$(Build.Repository.LocalPath)/artifacts/${{ parameters.runtime }}" `
-c Release `
- -f net8.0 `
+ -f net10.0 `
-r $runtime `
--self-contained `
--no-restore `
diff --git a/eng/ci/templates/public/jobs/build-cli.yml b/eng/ci/templates/public/jobs/build-cli.yml
index ceeb5d7c2..58a4b7470 100644
--- a/eng/ci/templates/public/jobs/build-cli.yml
+++ b/eng/ci/templates/public/jobs/build-cli.yml
@@ -37,7 +37,7 @@ jobs:
dotnet publish src/Cli/func/Azure.Functions.Cli.csproj `
-o "$(Build.ArtifactStagingDirectory)/artifacts/$runtime" `
-c Release `
- -f net8.0 `
+ -f net10.0 `
-r $runtime `
--self-contained `
/p:ZipAfterPublish=true `
diff --git a/eng/ci/templates/public/steps/run-unit-tests.yml b/eng/ci/templates/public/steps/run-unit-tests.yml
index 8731b5353..627133001 100644
--- a/eng/ci/templates/public/steps/run-unit-tests.yml
+++ b/eng/ci/templates/public/steps/run-unit-tests.yml
@@ -4,7 +4,7 @@ steps:
inputs:
command: 'test'
projects: '**/Azure.Functions.Cli.UnitTests.csproj'
- arguments: '--framework net8.0'
+ arguments: '--framework net10.0'
- task: PublishTestResults@2
displayName: 'Publish test results'
diff --git a/eng/ci/templates/steps/run-e2e-tests.yml b/eng/ci/templates/steps/run-e2e-tests.yml
index 98a12965a..1a826bf98 100644
--- a/eng/ci/templates/steps/run-e2e-tests.yml
+++ b/eng/ci/templates/steps/run-e2e-tests.yml
@@ -42,7 +42,7 @@ steps:
$worker = '${{ parameters.worker }}'
$proj = '$(Build.SourcesDirectory)/test/Cli/Func.E2ETests/Azure.Functions.Cli.E2ETests.csproj'
$baseArgs = @(
- '--framework', 'net8.0'
+ '--framework', 'net10.0'
'--blame-hang-timeout', '10m'
'--logger', 'console;verbosity=detailed'
'--logger', 'trx'
diff --git a/eng/scripts/validate-worker-versions.ps1 b/eng/scripts/validate-worker-versions.ps1
index 5fa75ec05..ce0c19272 100644
--- a/eng/scripts/validate-worker-versions.ps1
+++ b/eng/scripts/validate-worker-versions.ps1
@@ -87,7 +87,7 @@ $workerPropsToWorkerName = @{
"eng/build/Workers.Node.props" = @("NodeJsWorker")
"eng/build/Workers.Java.props" = @("JavaWorker")
"eng/build/Workers.Python.props" = @("PythonWorker")
- "eng/build/Workers.Powershell.props" = @("PowerShellWorker.PS7.0", "PowerShellWorker.PS7.2", "PowerShellWorker.PS7.4")
+ "eng/build/Workers.Powershell.props" = @("PowerShellWorker.PS7.0", "PowerShellWorker.PS7.2", "PowerShellWorker.PS7.4", "PowerShellWorker.PS7.6")
}
$failedValidation = $false
diff --git a/global.json b/global.json
index 312117ebc..08cef221c 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
- "version": "10.0.201",
+ "version": "10.0.103",
"allowPrerelease": true,
"rollForward": "latestMajor"
},
diff --git a/release_notes.md b/release_notes.md
index 7a42a4ff6..b333d7488 100644
--- a/release_notes.md
+++ b/release_notes.md
@@ -1,12 +1,22 @@
-# Azure Functions CLI 4.9.0
+# Azure Functions CLI 4.11.0
#### Host Version
-- Host Runtime Version: 4.1047.100
+- Host Runtime Version: 4.1049.200
- In-Proc CLI:
- CLI Version: 4.4.0
- Host Runtime Version: 4.46.100 (includes 4.846.100, 4.646.100)
#### Changes
-- Fixed `func pack --python` stripping `.dist-info` directories from packaged dependencies (#4853)
+- Updated target framework to .NET 10
+ - Migrated from deprecated `Microsoft.DotNet.PlatformAbstractions` to `System.Runtime.InteropServices.RuntimeInformation`
+ - Migrated from deprecated `X509Certificate2` constructor to `X509CertificateLoader`
+ - Bumped `Microsoft.Extensions.DependencyInjection` to 10.0.0
+ - Bumped `Microsoft.Extensions.Logging` / `Logging.Abstractions` to 10.0.0 / 10.0.3
+ - Bumped `Azure.Identity` to 1.20.0, `Azure.Security.KeyVault.Secrets` to 4.9.0
+ - Bumped `Microsoft.Identity.Client` to 4.83.3
+ - Bumped `Newtonsoft.Json` to 13.0.4, `WindowsAzure.Storage` to 9.3.3
+ - Removed unnecessary transitive pinning of `System.Text.Json`, `System.Formats.Asn1`, `System.Private.Uri`
+ - Updated worker versions to match host requirements (NodeJs 3.13.0, Python 4.44.0)
+
diff --git a/skipPackagesCve.json b/skipPackagesCve.json
index 19bdfa9b2..f42b62ce0 100644
--- a/skipPackagesCve.json
+++ b/skipPackagesCve.json
@@ -1,4 +1,8 @@
{
+ "_comments": {
+ "NuGet.Packaging": "Pinned to 5.11.6 transitively by the Functions host (Microsoft.Azure.WebJobs.Script.WebHost -> NuGet.ProjectModel -> NuGet.DependencyResolver.Core -> NuGet.Protocol -> NuGet.Packaging). Cannot upgrade independently until the host moves to NuGet 6.x. Advisory: GHSA-g4vj-cjjj-v7hg (Low)."
+ },
"packages": [
+ "NuGet.Packaging"
]
}
\ No newline at end of file
diff --git a/src/ArtifactAssembler/ArtifactAssembler.csproj b/src/ArtifactAssembler/ArtifactAssembler.csproj
index 402a859af..849bd6e3d 100644
--- a/src/ArtifactAssembler/ArtifactAssembler.csproj
+++ b/src/ArtifactAssembler/ArtifactAssembler.csproj
@@ -1,7 +1,7 @@
- net8.0
+ net10.0
Exe
diff --git a/src/Cli/Abstractions/Azure.Functions.Cli.Abstractions.csproj b/src/Cli/Abstractions/Azure.Functions.Cli.Abstractions.csproj
index 00e35bfd8..eddaaa693 100644
--- a/src/Cli/Abstractions/Azure.Functions.Cli.Abstractions.csproj
+++ b/src/Cli/Abstractions/Azure.Functions.Cli.Abstractions.csproj
@@ -1,7 +1,7 @@
- net8.0
+ net10.0
true
Library
diff --git a/src/Cli/func/Actions/HostActions/StartHostAction.cs b/src/Cli/func/Actions/HostActions/StartHostAction.cs
index cfd66e216..d9d66f60f 100644
--- a/src/Cli/func/Actions/HostActions/StartHostAction.cs
+++ b/src/Cli/func/Actions/HostActions/StartHostAction.cs
@@ -185,6 +185,7 @@ public override ICommandLineParserResult ParseArgs(string[] args)
return base.ParseArgs(args);
}
+#pragma warning disable ASPDEPR008 // Startup implements IStartup which requires IWebHost lifecycle
private async Task BuildWebHost(ScriptApplicationHostOptions hostOptions, Uri listenAddress, Uri baseAddress, X509Certificate2 certificate)
{
LoggingFilterHelper loggingFilterHelper = new LoggingFilterHelper(_hostJsonConfig, VerboseLogging, UserLogLevel);
@@ -281,6 +282,7 @@ private async Task BuildWebHost(ScriptApplicationHostOptions hostOptio
})
.Build();
}
+#pragma warning restore ASPDEPR008
internal async Task> GetConfigurationSettings(string scriptPath, Uri uri)
{
@@ -465,7 +467,9 @@ public override async Task RunAsync()
await ExtensionBundleHelper.GetExtensionBundle();
}
+#pragma warning disable ASPDEPR008
IWebHost host = await BuildWebHost(hostOptions, listenUri, baseUri, certificate);
+#pragma warning restore ASPDEPR008
var runTask = host.RunAsync();
var hostService = host.Services.GetRequiredService();
diff --git a/src/Cli/func/Actions/LocalActions/InitAction/InitAction.cs b/src/Cli/func/Actions/LocalActions/InitAction/InitAction.cs
index 2b44e156b..2a3de042a 100644
--- a/src/Cli/func/Actions/LocalActions/InitAction/InitAction.cs
+++ b/src/Cli/func/Actions/LocalActions/InitAction/InitAction.cs
@@ -484,7 +484,7 @@ private static async Task WriteDockerfile(WorkerRuntime workerRuntime, string la
}
else if (workerRuntime == Helpers.WorkerRuntime.Powershell)
{
- await FileSystemHelpers.WriteFileIfNotExists("Dockerfile", await StaticResources.DockerfilePowershell72);
+ await FileSystemHelpers.WriteFileIfNotExists("Dockerfile", await StaticResources.DockerfilePowershell74);
}
else if (workerRuntime == Helpers.WorkerRuntime.Custom)
{
diff --git a/src/Cli/func/Azure.Functions.Cli.csproj b/src/Cli/func/Azure.Functions.Cli.csproj
index 63374632d..0824b56ad 100644
--- a/src/Cli/func/Azure.Functions.Cli.csproj
+++ b/src/Cli/func/Azure.Functions.Cli.csproj
@@ -1,6 +1,6 @@
- net8.0
+ net10.0
Exe
func
win-x64;win-x86;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64
@@ -42,12 +42,9 @@
-
-
-
@@ -56,6 +53,7 @@
+
diff --git a/src/Cli/func/Directory.Version.props b/src/Cli/func/Directory.Version.props
index 1d504ab86..00f0ab9d4 100644
--- a/src/Cli/func/Directory.Version.props
+++ b/src/Cli/func/Directory.Version.props
@@ -1,7 +1,7 @@
- 4.9.0
+ 4.11.0
true
diff --git a/src/Cli/func/Helpers/SecurityHelpers.cs b/src/Cli/func/Helpers/SecurityHelpers.cs
index bcf2838bc..4089653ff 100644
--- a/src/Cli/func/Helpers/SecurityHelpers.cs
+++ b/src/Cli/func/Helpers/SecurityHelpers.cs
@@ -54,7 +54,7 @@ internal static async Task GetOrCreateCertificate(string certP
certPassword = File.Exists(certPassword)
? File.ReadAllText(certPassword).Trim()
: certPassword;
- return new X509Certificate2(certPath, certPassword);
+ return X509CertificateLoader.LoadPkcs12FromFile(certPath, certPassword);
}
else if (CommandChecker.CommandExists("openssl"))
{
@@ -116,7 +116,7 @@ internal static async Task CreateCertificateOpenSSL()
throw new CliException($"Could not create a Certificate using openssl.");
}
- return new X509Certificate2($"{certFileNames}certificate.pfx", DEFAULT_PASSWORD);
+ return X509CertificateLoader.LoadPkcs12FromFile($"{certFileNames}certificate.pfx", DEFAULT_PASSWORD);
}
public static string CalculateMd5(Stream stream)
diff --git a/src/Cli/func/StaticResources/Dockerfile.powershell7.4 b/src/Cli/func/StaticResources/Dockerfile.powershell7.4
new file mode 100644
index 000000000..ffa1d639c
--- /dev/null
+++ b/src/Cli/func/StaticResources/Dockerfile.powershell7.4
@@ -0,0 +1,7 @@
+# To enable ssh & remote debugging on app service change the base image to the one below
+# FROM mcr.microsoft.com/azure-functions/powershell:4-powershell7.4-appservice
+FROM mcr.microsoft.com/azure-functions/powershell:4-powershell7.4
+ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
+ AzureFunctionsJobHost__Logging__Console__IsEnabled=true
+
+COPY . /home/site/wwwroot
diff --git a/src/Cli/func/StaticResources/StaticResources.cs b/src/Cli/func/StaticResources/StaticResources.cs
index 6638e30e9..1aff8319f 100644
--- a/src/Cli/func/StaticResources/StaticResources.cs
+++ b/src/Cli/func/StaticResources/StaticResources.cs
@@ -54,6 +54,8 @@ public static class StaticResources
public static Task DockerfilePowershell72 => GetValue("Dockerfile.powershell7.2");
+ public static Task DockerfilePowershell74 => GetValue("Dockerfile.powershell7.4");
+
public static Task DockerfileJavaScript => GetValue("Dockerfile.javascript");
public static Task DockerfileTypeScript => GetValue("Dockerfile.typescript");
@@ -116,10 +118,15 @@ public static async Task GetValue(string name)
using (var reader = new StreamReader(stream))
{
var sb = new StringBuilder();
- while (!reader.EndOfStream)
+ string line;
+ while ((line = await reader.ReadLineAsync()) != null)
{
- var line = await reader.ReadLineAsync();
- sb.AppendFormat("{0}{1}", line, reader.EndOfStream ? string.Empty : Environment.NewLine);
+ if (sb.Length > 0)
+ {
+ sb.Append(Environment.NewLine);
+ }
+
+ sb.Append(line);
}
return sb.ToString();
diff --git a/src/Cli/func/StaticResources/StaticResources.props b/src/Cli/func/StaticResources/StaticResources.props
index 51c58a142..28e240d79 100644
--- a/src/Cli/func/StaticResources/StaticResources.props
+++ b/src/Cli/func/StaticResources/StaticResources.props
@@ -58,6 +58,9 @@
$(AssemblyName).Dockerfile.powershell7.2
+
+ $(AssemblyName).Dockerfile.powershell7.4
+
$(AssemblyName).Dockerfile.python3.9
diff --git a/src/Cli/func/StaticResources/stacks.json b/src/Cli/func/StaticResources/stacks.json
index 941059a62..8f9ce06e2 100644
--- a/src/Cli/func/StaticResources/stacks.json
+++ b/src/Cli/func/StaticResources/stacks.json
@@ -2716,6 +2716,105 @@
"displayText": "PowerShell 7",
"value": "7",
"minorVersions": [
+ {
+ "displayText": "PowerShell 7.6",
+ "value": "7.6",
+ "stackSettings": {
+ "windowsRuntimeSettings": {
+ "runtimeVersion": "7.6",
+ "isDefault": false,
+ "isPreview": true,
+ "isHidden": true,
+ "remoteDebuggingSupported": false,
+ "appInsightsSettings": {
+ "isSupported": true
+ },
+ "gitHubActionSettings": {
+ "isSupported": true
+ },
+ "appSettingsDictionary": {
+ "FUNCTIONS_WORKER_RUNTIME": "powershell"
+ },
+ "siteConfigPropertiesDictionary": {
+ "use32BitWorkerProcess": false,
+ "powerShellVersion": "7.6",
+ "netFrameworkVersion": "v10.0"
+ },
+ "supportedFunctionsExtensionVersions": [
+ "~4"
+ ],
+ "supportedFunctionsExtensionVersionsInfo": [
+ {
+ "version": "~4",
+ "isDeprecated": false,
+ "isDefault": true
+ }
+ ],
+ "endOfLifeDate": "Tue Nov 14 2028 00:00:00 GMT+0000 (Coordinated Universal Time)"
+ },
+ "linuxRuntimeSettings": {
+ "runtimeVersion": "PowerShell|7.6",
+ "isDefault": false,
+ "isPreview": true,
+ "isHidden": true,
+ "remoteDebuggingSupported": false,
+ "appInsightsSettings": {
+ "isSupported": true
+ },
+ "gitHubActionSettings": {
+ "isSupported": true
+ },
+ "appSettingsDictionary": {
+ "FUNCTIONS_WORKER_RUNTIME": "powershell"
+ },
+ "siteConfigPropertiesDictionary": {
+ "use32BitWorkerProcess": false,
+ "linuxFxVersion": "PowerShell|7.6"
+ },
+ "supportedFunctionsExtensionVersions": [
+ "~4"
+ ],
+ "supportedFunctionsExtensionVersionsInfo": [
+ {
+ "version": "~4",
+ "isDeprecated": false,
+ "isDefault": true
+ }
+ ],
+ "Sku": [
+ {
+ "skuCode": "FC1",
+ "instanceMemoryMB": [
+ {
+ "size": 512,
+ "isDefault": false
+ },
+ {
+ "size": 2048,
+ "isDefault": true
+ },
+ {
+ "size": 4096,
+ "isDefault": false
+ }
+ ],
+ "maximumInstanceCount": {
+ "lowestMaximumInstanceCount": 40,
+ "highestMaximumInstanceCount": 1000,
+ "defaultValue": 100
+ },
+ "functionAppConfigProperties": {
+ "runtime": {
+ "name": "powershell",
+ "version": "7.6"
+ }
+ }
+ }
+ ],
+ "endOfLifeDate": "Tue Nov 14 2028 00:00:00 GMT+0000 (Coordinated Universal Time)"
+ }
+ }
+ },
{
"displayText": "PowerShell 7.4",
"value": "7.4",
diff --git a/src/Cli/func/Telemetry/DockerContainerDetectorForTelemetry.cs b/src/Cli/func/Telemetry/DockerContainerDetectorForTelemetry.cs
index 69ecd430b..003e5f7d6 100644
--- a/src/Cli/func/Telemetry/DockerContainerDetectorForTelemetry.cs
+++ b/src/Cli/func/Telemetry/DockerContainerDetectorForTelemetry.cs
@@ -1,8 +1,8 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
+using System.Runtime.InteropServices;
using System.Security;
-using Microsoft.DotNet.PlatformAbstractions;
using Microsoft.Win32;
namespace Azure.Functions.Cli.Telemetry
@@ -18,46 +18,48 @@ internal class DockerContainerDetectorForTelemetry : IDockerContainerDetector
{
public DockerContainer IsDockerContainer()
{
- switch (RuntimeEnvironment.OperatingSystemPlatform)
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
- case Platform.Windows:
- try
- {
+ try
+ {
#pragma warning disable CA1416 // Validate platform compatibility - This is a windows only code path.
- using var subkey = Registry.LocalMachine.OpenSubKey("System\\CurrentControlSet\\Control");
+ using var subkey = Registry.LocalMachine.OpenSubKey("System\\CurrentControlSet\\Control");
- return subkey?.GetValue("ContainerType") != null
- ? DockerContainer.True
- : DockerContainer.False;
+ return subkey?.GetValue("ContainerType") != null
+ ? DockerContainer.True
+ : DockerContainer.False;
#pragma warning restore CA1416 // Validate platform compatibility
- }
- catch (SecurityException)
- {
- return DockerContainer.Unknown;
- }
-
- case Platform.Linux:
- try
- {
- return ReadProcToDetectDockerInLinux()
- ? DockerContainer.True
- : DockerContainer.False;
- }
- catch (Exception ex) when (ex is IOException || ex.InnerException is IOException)
- {
- // In some environments (restricted docker container, shared hosting etc.),
- // procfs is not accessible and we get UnauthorizedAccessException while the
- // inner exception is set to IOException. In this case, it is unknown.
- return DockerContainer.Unknown;
- }
-
- case Platform.Unknown:
+ }
+ catch (SecurityException)
+ {
+ return DockerContainer.Unknown;
+ }
+ }
+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ {
+ try
+ {
+ return ReadProcToDetectDockerInLinux()
+ ? DockerContainer.True
+ : DockerContainer.False;
+ }
+ catch (Exception ex) when (ex is IOException || ex.InnerException is IOException)
+ {
+ // In some environments (restricted docker container, shared hosting etc.),
+ // procfs is not accessible and we get UnauthorizedAccessException while the
+ // inner exception is set to IOException. In this case, it is unknown.
return DockerContainer.Unknown;
- case Platform.Darwin:
- default:
- return DockerContainer.False;
+ }
+ }
+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+ {
+ return DockerContainer.False;
+ }
+ else
+ {
+ return DockerContainer.Unknown;
}
}
diff --git a/src/Cli/func/Telemetry/ExternalTelemetryProperties.cs b/src/Cli/func/Telemetry/ExternalTelemetryProperties.cs
index 7f7b1973e..e463a235a 100644
--- a/src/Cli/func/Telemetry/ExternalTelemetryProperties.cs
+++ b/src/Cli/func/Telemetry/ExternalTelemetryProperties.cs
@@ -5,9 +5,7 @@
using System.Globalization;
using System.Runtime.InteropServices;
using System.Security;
-using Microsoft.DotNet.PlatformAbstractions;
using Microsoft.Win32;
-using RuntimeEnvironment = Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment;
namespace Azure.Functions.Cli.Telemetry
{
@@ -53,7 +51,7 @@ internal static string GetInstallationType()
///
internal static string GetProductType()
{
- if (RuntimeEnvironment.OperatingSystemPlatform != Platform.Windows)
+ if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return string.Empty;
}
@@ -96,7 +94,7 @@ internal static string GetProductType()
///
internal static string GetLibcRelease()
{
- if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows)
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return string.Empty;
}
@@ -121,7 +119,7 @@ internal static string GetLibcRelease()
///
internal static string GetLibcVersion()
{
- if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows)
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return string.Empty;
}
diff --git a/src/Cli/func/Telemetry/Telemetry.cs b/src/Cli/func/Telemetry/Telemetry.cs
index f3c5103b6..7eacdb317 100644
--- a/src/Cli/func/Telemetry/Telemetry.cs
+++ b/src/Cli/func/Telemetry/Telemetry.cs
@@ -1,11 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
+using System.Runtime.InteropServices;
using Azure.Functions.Cli.Common;
using Colors.Net;
using Microsoft.ApplicationInsights;
using Microsoft.ApplicationInsights.Extensibility;
-using Microsoft.DotNet.PlatformAbstractions;
namespace Azure.Functions.Cli.Telemetry
{
@@ -93,7 +93,7 @@ private void InitializeTelemetry()
};
_client = new TelemetryClient(telemetryConfiguration);
_client.Context.Session.Id = _currentSessionId;
- _client.Context.Device.OperatingSystem = RuntimeEnvironment.OperatingSystem;
+ _client.Context.Device.OperatingSystem = RuntimeInformation.OSDescription;
// We don't want to log this.
// Setting it to null doesn't work. So might as well log the session id.
diff --git a/src/Cli/func/Telemetry/TelemetryCommonProperties.cs b/src/Cli/func/Telemetry/TelemetryCommonProperties.cs
index 4202f6ea8..c3ec95262 100644
--- a/src/Cli/func/Telemetry/TelemetryCommonProperties.cs
+++ b/src/Cli/func/Telemetry/TelemetryCommonProperties.cs
@@ -3,7 +3,6 @@
using Azure.Functions.Cli.Common;
using Azure.Functions.Cli.Interfaces;
-using RuntimeEnvironment = Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment;
using RuntimeInformation = System.Runtime.InteropServices.RuntimeInformation;
namespace Azure.Functions.Cli.Telemetry
@@ -49,10 +48,10 @@ public Dictionary GetTelemetryCommonProperties()
{
return new Dictionary
{
- { OSVersion, RuntimeEnvironment.OperatingSystemVersion },
- { OSPlatform, RuntimeEnvironment.OperatingSystemPlatform.ToString() },
+ { OSVersion, Environment.OSVersion.VersionString },
+ { OSPlatform, RuntimeInformation.OSDescription },
{ OutputRedirected, Console.IsOutputRedirected.ToString() },
- { RuntimeId, RuntimeEnvironment.GetRuntimeIdentifier() },
+ { RuntimeId, RuntimeInformation.RuntimeIdentifier },
{ ProductVersion, Constants.CliVersion },
{ TelemetryProfile, Environment.GetEnvironmentVariable(TelemetryProfileEnvironmentVariable) },
{ DockerContainer, IsDockerContainerCache() },
diff --git a/src/CoreToolsHost/CoreToolsHost.csproj b/src/CoreToolsHost/CoreToolsHost.csproj
index 5b8e14dcf..9d53a83c7 100644
--- a/src/CoreToolsHost/CoreToolsHost.csproj
+++ b/src/CoreToolsHost/CoreToolsHost.csproj
@@ -2,7 +2,7 @@
Exe
- net9.0
+ net10.0
True
true
Guard
diff --git a/src/GoZipTool/GoZipTool.csproj b/src/GoZipTool/GoZipTool.csproj
index 40de8f712..b35efbe92 100644
--- a/src/GoZipTool/GoZipTool.csproj
+++ b/src/GoZipTool/GoZipTool.csproj
@@ -1,7 +1,7 @@
- net8.0
+ net10.0
$(RuntimeIdentifier)
diff --git a/test/Cli/Func.E2ETests/Azure.Functions.Cli.E2ETests.csproj b/test/Cli/Func.E2ETests/Azure.Functions.Cli.E2ETests.csproj
index c4f9618cc..3a41e41de 100644
--- a/test/Cli/Func.E2ETests/Azure.Functions.Cli.E2ETests.csproj
+++ b/test/Cli/Func.E2ETests/Azure.Functions.Cli.E2ETests.csproj
@@ -1,7 +1,7 @@
- net8.0
+ net10.0
true
diff --git a/test/Cli/Func.UnitTests/Azure.Functions.Cli.UnitTests.csproj b/test/Cli/Func.UnitTests/Azure.Functions.Cli.UnitTests.csproj
index 2c00f8d44..289d099a4 100644
--- a/test/Cli/Func.UnitTests/Azure.Functions.Cli.UnitTests.csproj
+++ b/test/Cli/Func.UnitTests/Azure.Functions.Cli.UnitTests.csproj
@@ -1,7 +1,7 @@
- net8.0
+ net10.0
true
false
true
diff --git a/test/Cli/TestFramework/Azure.Functions.Cli.TestFramework.csproj b/test/Cli/TestFramework/Azure.Functions.Cli.TestFramework.csproj
index ce8353b80..a707981ed 100644
--- a/test/Cli/TestFramework/Azure.Functions.Cli.TestFramework.csproj
+++ b/test/Cli/TestFramework/Azure.Functions.Cli.TestFramework.csproj
@@ -1,7 +1,7 @@
- net8.0
+ net10.0
true
diff --git a/test/ZippedExe/ZippedExe.csproj b/test/ZippedExe/ZippedExe.csproj
index 0e0fead50..ba1b34b94 100644
--- a/test/ZippedExe/ZippedExe.csproj
+++ b/test/ZippedExe/ZippedExe.csproj
@@ -1,7 +1,7 @@
- net8.0
+ net10.0
Exe
true