Comments (4)
Ok so I worked it out!
The issue was that I was trying to inject entity framework core using the Function Monkey IFunctionAppConfiguration builder. You actually need to register other dependencies through the standard Startup.cs dependency injection.. as per below.
using FunctionMonkeyTest.Models;
using Microsoft.Azure.Functions.Extensions.DependencyInjection;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using System;
[assembly: FunctionsStartup(typeof(FunctionMonkeyTest.Startup))]
namespace FunctionMonkeyTest
{
class Startup : FunctionsStartup
{
public override void Configure(IFunctionsHostBuilder builder)
{
string SqlConnection = Environment.GetEnvironmentVariable("AuthDBConnectionString");
builder.Services.AddDbContext(
options => options.UseSqlServer(SqlConnection));
}
}
}
from functionmonkey.
What version of Function Monkey do you use?
from functionmonkey.
What version of Function Monkey do you use?
I was using the latest beta version v4.0.56-beta.4
What should I be using? I followed all of the instructions on the getting started page and had everything working fine until I tried to add entity framework dependency injection via the function app configuration... On thinking about this, is the Function Monkey IFunctionAppConfiguration only to be used to put DI for Function Monkey specific things and if I want to inject other services I.e. Entity Framework then I should use the standard Microsoft Dependency Injection Function Startup? Maybe that is where I am going wrong?
from functionmonkey.
I am using the same version of the package. And also i see:
Im not sure but maybe problem in Microsoft.NET.Sdk.Functions
package. Which version of Microsoft.NET.Sdk.Functions are you using?
from functionmonkey.
Related Issues (20)
- CamelCaseJsonSerializer does not work for ExpandoObject
- HttpResponseHandler not used for BadParameterResponse in http.csharp.handlebars HOT 1
- Receive and add CancellationToken to DI to enable for graceful shutdowns HOT 1
- Compiling Azure Functions with NuGet package dependencies fails HOT 13
- Problems with StorageQueue in 4.0.56-beta4 HOT 2
- Event Grid Triggers
- Unable to upload a file
- HowTo BeforeServiceProviderBuild HOT 1
- Solution Structure
- Http Trigger: AuthorizationLevel.Anonymous runs ClaimsPrincipalAuthorization but it should be ignored HOT 3
- How to access Cookie (and QueryString) collection ?
- Future of Function Monkey HOT 10
- Add Validators via Assembly search not working HOT 2
- Primitives / Arrays in HTTP body
- Need a way to access full HttpContext HOT 2
- FunctionMonkey.Compiler can't be built
- Accessing request headers
- Azure App Configuration in Configuration.
- CosmosDB lease container appears inoperable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from functionmonkey.