Open anime-shed opened 1 month ago
Thanks for informing will check and confirm the same.
I checked it seems fine.can you try again else share your code also.
I'm sorry, it's a private project, so I won't be able to share the code. I can provide snippets that may help you debug the cause.
I tried to try again on my project, but for some reason, I am facing:
[2024-05-28T15:16:31.037Z] Found Using for user secrets file configuration.
[2024-05-28T15:16:32.849Z] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
[2024-05-28T15:16:32.899Z] The 'FUNCTIONNAME' function is in error: The binding type(s) 'blobTrigger' are not registered. Please ensure the type is correct and the binding extension is installed.
For detailed output, run func with --verbose flag.
I am also having the same issue after upgrading from .Net 6 to .Net 8.
Microsoft.Azure.WebJobs.Script: Error building configuration in an external startup class. FileNetWorkFlows.Workflows: Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=8.0.0.0
I even attempted adding that package to the project explicitly.
@dsgb1987, will it be possible to share your code snippet for @bhagyshricompany since I am facing an error on my end?
sample code using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Azure.Functions.Worker; using Microsoft.Extensions.Logging;
namespace FunctionApp1
{
public class Function1
{
private readonly ILogger
public Function1(ILogger<Function1> logger)
{
_logger = logger;
}
[Function("Function1")]
public IActionResult Run([HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequest req)
{
_logger.LogInformation("C# HTTP trigger function processed a request.");
return new OkObjectResult("Welcome to Azure Functions!");
}
}
}
I'm also having the same issue after upgrading from .net core 6.0 to 8.0 in an azure function. Runs locally but fails in Azure with the above error.
it seems this problem happens only when
<Nullable>enable</Nullable>
it seems this problem happens only when
<Nullable>enable</Nullable>
It runs fine with the IDEs (Visual Studio or Rider).
But on command-line func host start
, the problem occurs.
I'm using azfunc core tools 4.0.5858.
can you upgrade your version.
can you upgrade your version.
You mean me? My version is the latest now. (4.0.5858)
I also tried downgrading to your version (4.0.5801) but still the same issue.
Try to upgeade your asp.net core versions to latest one from 1.2.0 tolatest.Thanks
Thanks. I was using in-progress model. I switched to worker model and the problem is gone.
@quellatalo can you share what you changed?
@anime-shed
@quellatalo can you share what you changed?
I was using InProgress Model (Microsoft.NET.Sdk.Functions
) instead of Worker Model. The project was configured with net6.0
, and Nullable
enabled.
When I changed the target framework to net8.0
, I got the same error message about loading Microsoft.Extensions.Configuration.Abstractions, Version=8.0.0.0
.
NOTE: This problem does not occur when I run the az function using the IDEs (VisualStudio or Rider). It only happens with func core tools func host start
.
I found 2 ways:
I tried to investigate by simplify/minimize the project as much as possible.
Then when I removed the <Nullable>enable</Nullable>
line, the problem was gone.
However, this would break the whole project design. So, I need another approach.
There's an article about retiring InProgress Model. So I tried to switch to Worker model to see how it goes... and it just worked, even with Nullable enabled.
Considering your initial implementation is on Worker Model already. I think I can't really help you :(. Maybe checking installed versions might help. (There's a new func core tool 4.0.5907 released.)
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>true</IsPackable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0" />
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.22.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.3.2" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.6" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project>
func --version
: 4.0.5907
dotnet --version
: 8.0.302
New V4 app or existing V3 app migrated to V4: New App in V4
Also verified in dotnet 8 sdk
Case
We are creating Azure function v4 with .net core 8.
Error:
Packages