如何在Apple M1上获得Azure功能PowerShell ?



你们中有人对Apple M1的Azure Function PowerShell有工作解决方案吗?

我不能使它工作。到目前为止我所尝试的:

本地方法:

  • 安装。net Core 3.1 SDK
  • 已安装Azure功能工具4
  • 为PowerShell创建了一个带有HTTP触发函数的Azure函数

当我运行" function start"我得到以下错误信息:

An assembly specified in the application dependencies manifest (Microsoft.Azure.Functions.PowerShellWorker.deps.json) was not found:
package: 'runtime.osx-x64.runtime.native.System.IO.Ports', version: '4.7.0'

码头工人的方法:

  • 从"mcr.microsoft.com/azure-functions/powershell:4-powershell7.2"创建Docker映像。我已经尝试过它有和没有buildx——平台linux/amd64
  • 启动映像(包括使用和不使用——platform linux/amd64)

然后我得到以下错误:

fail: Host.Startup[515]
A host error has occurred during startup operation '6c64e86e-4fff-4784-a6b1-c86a60ac9c8e'.
System.IO.IOException: Function not implemented
at System.IO.FileSystemWatcher.StartRaisingEvents()
at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value)
at Microsoft.Azure.WebJobs.Script.IO.AutoRecoveringFileSystemWatcher.InitializeWatcher() in /src/azure-functions-host/src/WebJobs.Script/IO/AutoRecoveringFileSystemWatcher.cs:line 64
at Microsoft.Azure.WebJobs.Script.IO.AutoRecoveringFileSystemWatcher..ctor(String path, String filter, Boolean includeSubdirectories, WatcherChangeTypes changeTypes, ILoggerFactory loggerFactory) in /src/azure-functions-host/src/WebJobs.Script/IO/AutoRecoveringFileSystemWatcher.cs:line 43
at Microsoft.Azure.WebJobs.Script.Eventing.File.FileWatcherEventSource..ctor(IScriptEventManager eventManager, String source, String path, String filter, Boolean includeSubdirectories, WatcherChangeTypes changeTypes, ILoggerFactory loggerFactory) in /src/azure-functions-host/src/WebJobs.Script/Eventing/File/FileWatcherEventSource.cs:line 28
at Microsoft.Azure.WebJobs.Script.WebHost.FileMonitoringService.InitializeFileWatchers() in /src/azure-functions-host/src/WebJobs.Script.WebHost/FileMonitoringService.cs:line 157
at Microsoft.Azure.WebJobs.Script.WebHost.FileMonitoringService.StartAsync(CancellationToken cancellationToken) in /src/azure-functions-host/src/WebJobs.Script.WebHost/FileMonitoringService.cs:line 93
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Azure.WebJobs.Script.WebHost.WebJobsScriptHostService.UnsynchronizedStartHostAsync(ScriptHostStartupOperation activeOperation, Int32 attemptCount, JobHostStartupMode startupMode) in /src/azure-functions-host/src/WebJobs.Script.WebHost/WebJobsScriptHostService.cs:line 310

有办法让它在Apple M1上工作吗?

提前感谢您的帮助!

的问候亚历克斯

Apple M1目前尚未正式支持,但这可能行得通:

  1. 确保你已经安装了最新的Core Tools v4(4.0.4590+)。
  2. local.settings.json文件,设置FUNCTIONS_WORKER_RUNTIME_VERSION"7.2"。PowerShell 7.0在Apple M1上不支持(也可能不会)。

最新更新