azure-functions-core-tools: Permission denied when running "func start" on .NET 8 in-process Function on Ubuntu 20.04 - 22.04 - 24.04
- .NET SDK: 8.0.107
- Azure Function Core Tools: 4.0.5907
- Ubuntu 20.04 - 22.04 - 24.04 (WSL but same issue was experienced using GitHub Actions)
When I run func start I get the below error:
Failed to start the in-process model host. An error occurred trying to start process '/usr/lib/azure-functions-core-tools-4/in-proc8/func' with working directory '/home/gabriel/MyProjFolder/bin/output'. Permission denied
Steps taken:
func init MyProjFolder --worker-runtime dotnetcd MyProjFolder/func new --template "Http Trigger" --name MyHttpTrigger
I added FUNCTIONS_INPROC_NET8_ENABLED to local.settings.json:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"FUNCTIONS_INPROC_NET8_ENABLED": "1"
}
}
I updated the project to target .NET 8:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.4.0" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project>
I’m able to run an in-process .NET 8 on Windows using the Azure Function Core Tools and on a Windows Function App.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 18 (1 by maintainers)
I managed to get this working by re-signing the func binary using the codesign utility after updating the permissions.
First you need to generate a self-signed cert for code signing (details here) then:
@kshyju the latest release doesn’t seem to include this hotfix. When will it be released?
Same here with azure-functions-core-tools@4/4.0.5907.
Found a workaround which is working for me on MacOS:
chmod +x /usr/local/Cellar/azure-functions-core-tools@4/4.0.5907/in-proc8/funcI also updates this, not sure if this is required for the workaround:
<ItemGroup> <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.4.1" /> </ItemGroup>I got it working for me, its a very inconvenient workaround but it works. Maybe it helps anybody in the meantime. I am using a MacBook Pro M3, Sonoma 14.3
Same issue is happening on Ubuntu 22.04 as well since the release of
4.0.6610. Luckily the above mentioned fix applies:@Doo-Santi We want to run the functions as „in-process“ (dotnet). Using your settings will run the functions in „isolated“ mode (dotnet-isolated). I will try it anyway, to confirm it still works in isolated mode. Thanks!
@kshyju I saw your PR and I was able to fix the permissions problem as well using
chmod +x, but the function never starts now. When I usefunc host startI don’t get any error message it just exits execution:When I start the debugger (f5), it builds, but the nothing happens until I get a timeout error saying: “Failed to detect running Functions host within 60"seconds. You may want to adjust the “azureFunctions.pickProcessTimeout” setting.”
This behavior is even happening with new functions I created to test .net8 using the in-process model
I have Sonoma 14.5 macOs and I’m using:
Thanks @gabrielweyer We will investigate and share an update on this thread. .