Azure Functions v3, Dotnet Core v3.1 EF core /EF Core SQL 3.1.x No Errors no Data from SQL in Kubernetes

5/11/2020
  • using this image mcr.microsoft.com/azure-functions/dotnet:3.0. Running on baremetal kubernetes or local docker I get no errors but also no data from SQL Server. I am using the RabbitMq trigger to start the function on received message. The function is async and I use FunctionsStart in my startup.cs. I have confirmed the environment variable is set and correct at runtime. The context is not used directly in the function but is use by another IService that I inject.
  • Note - The code runs just fine in the debug emulator, connection and data return without issues. Also runs just fine with I remove EF and the MyDbContext.

        builder.Services
            .AddDbContext<MyDbContext>(options =>
                options.UseSqlServer(Environment.GetEnvironmentVariable("MY_DB")))

Note sure if this warning is related to the issue. warn: Microsoft.Azure.WebJobs.Script.ChangeAnalysis.ChangeAnalysisService[0] Breaking change analysis operation failed System.NotSupportedException: The invoked member is not supported in a dynamic assembly. at System.Reflection.Emit.InternalAssemblyBuilder.get_CodeBase() at Microsoft.Azure.WebJobs.Script.ChangeAnalysis.ChangeAnalysisService.LogBreakingChangeReport(CancellationToken cancellationToken) in /src/azure-functions-host/src/WebJobs.Script.WebHost/BreakingChangeAnalysis/ChangeAnalysisService.cs:line 140 at Microsoft.Azure.WebJobs.Script.ChangeAnalysis.ChangeAnalysisService.TryLogBreakingChangeReportAsync(CancellationToken cancellationToken) in /src/azure-functions-host/src/WebJobs.Script.WebHost/BreakingChangeAnalysis/ChangeAnalysisService.cs:line 103 [14:39:30 WRN] Breaking change analysis operation failed System.NotSupportedException: The invoked member is not supported in a dynamic assembly. at System.Reflection.Emit.InternalAssemblyBuilder.get_CodeBase() at Microsoft.Azure.WebJobs.Script.ChangeAnalysis.ChangeAnalysisService.LogBreakingChangeReport(CancellationToken cancellationToken) in /src/azure-functions-host/src/WebJobs.Script.WebHost/BreakingChangeAnalysis/ChangeAnalysisService.cs:line 140 at Microsoft.Azure.WebJobs.Script.ChangeAnalysis.ChangeAnalysisService.TryLogBreakingChangeReportAsync(CancellationToken cancellationToken) in /src/azure-functions-host/src/WebJobs.Script.WebHost/BreakingChangeAnalysis/ChangeAnalysisService.cs:line 103

-- Kentonbmax
azure-functions
entity-framework-core
kubernetes

0 Answers