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

发布于 2025-02-11 16:42:30 字数 2790 浏览 0 评论 0原文

您中的某人是否有针对Apple M1的Azure功能Powershell的工作解决方案?

我无法正常工作。到目前为止,我尝试过的是:

本地方法:

  • .NET CORE 3.1 SDK
  • 安装Azure功能工具4
  • 使用HTTP触发器函数为PowerShell创建了Azure函数

当我运行“ Func 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-funtions/powershell:4-powershell7.2”的Docker Image。我已经尝试过有或没有buildx -platform 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上工作?

事先感谢您的帮助!

问候 亚历克斯

does someone of you has a working solutions for Azure Function PowerShell for an Apple M1?

I was not able to get it working. What I've tried so far:

Local approach:

  • Installed .NET Core 3.1 SDK
  • Installed Azure Function Tools 4
  • Created Azure Function for PowerShell with a HTTP trigger function

When I run "func start" I'm getting the following error message:

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'

Docker approach:

  • Created Docker image from "mcr.microsoft.com/azure-functions/powershell:4-powershell7.2". I've tried it with and without buildx --platform linux/amd64
  • Started the image (also with and without --platform linux/amd64)

Then I get the following error:

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

Is there any way to get it working on an Apple M1?

Thanks in advance for your help!

Regards
Alex

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白衬杉格子梦 2025-02-18 16:42:30

此时,Apple M1不是正式支持的,但这可能有效:

  1. 确保您已安装了最新的核心工具V4(4.0.4590+)。
  2. local.settings.json文件中,设置functions_worker_runtime_version to “ 7.2”。 Powershell 7.0没有(也可能不会)在Apple M1上得到支持。

Apple M1 is not officially supported at this point, but this may work:

  1. Make sure you have the latest Core Tools v4 installed (4.0.4590+).
  2. In the local.settings.json file, set FUNCTIONS_WORKER_RUNTIME_VERSION to "7.2". PowerShell 7.0 is not (and probably will not be) supported on Apple M1.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文