Cannot run Azure Durable Functions on Mac M2 PRO
See original GitHub issueDescription
When trying to create and run a new Azure Durable Function (.NET 7 | Isolated), I am unable to run it successfully.
A host error has occurred during startup operation '8643db33-586e-4c53-92d0-476fbeb08331'.
[2023-04-12T20:49:22.183Z] Grpc.Core: Error loading native library. Not found in any of the possible locations: /Users/apavate/Documents/Visual Studio Projects/OpenAIApps/DocumentUnderstanding/bin/Debug/net7.0/.azurefunctions/libgrpc_csharp_ext.arm64.dylib,/Users/apavate/Documents/Visual Studio Projects/OpenAIApps/DocumentUnderstanding/bin/Debug/net7.0/.azurefunctions/runtimes/osx-arm64/native/libgrpc_csharp_ext.arm64.dylib,/Users/apavate/Documents/Visual Studio Projects/OpenAIApps/DocumentUnderstanding/bin/Debug/net7.0/.azurefunctions/../../runtimes/osx-arm64/native/libgrpc_csharp_ext.arm64.dylib.
Value cannot be null. (Parameter 'provider')
NOTE: JavaScript issues should be reported here: https://github.com/Azure/azure-functions-durable-js
Expected behavior
Should run without any issues.
Actual behavior
Does not run.
Relevant source code snippets
Boiler-plate code generated when a new project is created inside Visual Studio for Mac.
### Known workarounds
> Provide a description of any known workarounds you used.
### App Details
- **Durable Functions extension version (e.g. v1.8.3)**:
- **Azure Functions runtime version (1.0 or 2.0)**:
- **Programming language used**:
### Screenshots
> If applicable, add screenshots to help explain your problem.
### If deployed to Azure
> We have access to a lot of telemetry that can help with investigations. Please provide as much of the following information as you can to help us investigate!
- **Timeframe issue observed**:
- **Function App name**:
- **Function name(s)**:
- **Azure region**:
- **Orchestration instance ID(s)**:
- **Azure storage account name**:
> If you don't want to share your Function App or storage account name GitHub, please at least share the orchestration instance ID. Otherwise it's extremely difficult to look up information.
Issue Analytics
- State:
- Created 5 months ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Dotnet-Isolated Durable Functions On M1 Mac Breaking ...
I'm running this in an M1 MacBook Pro running Ventura 13.2, using .net 7 and Azure Functions V4 dotnet-isolated model. Here are some...
Read more >Support running on M1 Macs · Issue #2834 · Azure ...
but when I try to use it inside an azure function it doesn't work. Im running on python 3.9.10 on Latest Azure functions...
Read more >Azure Functions on MacOs - Visual Studio for Mac
Azure Functions is a way to create and run event-driven snippets of code –– functions –– in the cloud, without having to explicitly...
Read more >How to develop python azure function my Mac with chip ...
Run the function locally. You can do this by opening a terminal window, navigating to the project directory, and running the following command: ......
Read more >Macbook M1 error with Python Azure function
1 Answer. This issue might occur due to the Azure function extension and debugger not getting attached or initiated while you're running your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I want to update the instructions to make it easy for other developers.
Add the Nuget package
Contrib.Grpc.Core.M1
to the Azure Function Project by either using the Nuget Package Manager or by just adding the following line to the.csproj
file.<PackageReference Include="Contrib.Grpc.Core.M1" Version="2.41.0" />
Add the following line to the
.csproj
file right before the last</Project>
tag.<Target Name="CopyGrpcNativeAssetsToOutDir" AfterTargets="Build"> <ItemGroup> <NativeAssetToCopy Condition="$([MSBuild]::IsOSPlatform('OSX'))" Include="$(OutDir)runtimes/osx-arm64/native/*" /> </ItemGroup> <Copy SourceFiles="@(NativeAssetToCopy)" DestinationFolder="$(OutDir).azurefunctions/runtimes/osx-arm64/native" /> </Target>
Run the project and it should work!
Solution Credits: @vdboots
For now as a workaround:
Add the package reference
<PackageReference Include="Contrib.Grpc.Core.M1" Version="2.41.0" />
And add this to your csproj.
<Target Name="CopyGrpcNativeAssetsToOutDir" AfterTargets="Build"> <ItemGroup> <NativeAssetToCopy Condition="$([MSBuild]::IsOSPlatform('OSX'))" Include="$(OutDir)runtimes/osx-arm64/native/*" /> </ItemGroup> <Copy SourceFiles="@(NativeAssetToCopy)" DestinationFolder="$(OutDir).azurefunctions/runtimes/osx-arm64/native" /> </Target>
This will copy the needed file to the folder required. Until there is a fix