title: Microsoft.EntityFrameworkCore: No database provider has been configured for this DbContext
body: <p>I am attempting to put my connection string in the local settings .json file in an Azur e Function (v3) for entity framework core.</p>
  <p>I am getting an errors saying.</p>
  <blockquote>
  <p>ystem.Private.CoreLib: Exception while executing function: Function1.
  Microsoft.EntityFrameworkCore: No database provider has been
  configured for this DbContext. A provider can be configured by
  overriding the DbContext.OnConfiguring method or by using AddDbContext
  on the application service provider. If AddDbContext is used, then
  also ensure that your DbContext type accepts a
  DbContextOptions object in its constructor and passes it to
  the base constructor for DbContext.</p>
  </blockquote>
  <p>So I have removed the connection string in OnCofiguration on the context</p>
  <pre><code>     protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
          {
              if (!optionsBuilder.IsConfigured)
              {
  #warning 
              // optionsBuilder.UseSqlServer(&quot;Server=tcp:xxxxx.database.windows.net,1433;Initial Catalog=CatsDB;Persist Security Info=False;User ID=!;Password=!;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;&quot;);
              }
          }
  </code></pre>
  <p>I am using Dependency Injection in a startup.cs class :</p>
  <pre><code>[assembly: FunctionsStartup(typeof(Startup))]
  
  namespace Shizzle
  {
      class Startup : FunctionsStartup
       {
      
        public override void Configure(IFunctionsHostBuilder builder)
        {
            builder.Services.AddDbContext&lt;CatsDBContext&gt;(
                  options =&gt; options.UseSqlServer(ConfigurationManager.ConnectionStrings[&quot;SqlConnectionString&quot;].ConnectionString));
        }
       }
  </code></pre>
  <p>And finally I am storing the connection string in local.settings.json</p>
  <pre><code>{
      &quot;IsEncrypted&quot;: false,
    &quot;Values&quot;: {
      &quot;AzureWebJobsStorage&quot;: &quot;UseDevelopmentStorage=true&quot;,
      &quot;FUNCTIONS_WORKER_RUNTIME&quot;: &quot;dotnet&quot;
    },
    &quot;ConnectionStrings&quot;: {
      &quot;SqlConnectionString&quot;: &quot;Server=tcp:xxxx.database.windows.net,1433;Initial Catalog=CatsDB;Persist Security Info=False;User ID=!;Password=0!;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;&quot;
    }
  }
  </code></pre>
  <p>and this is the DBContext :</p>
  <pre><code>using System;
  using Microsoft.EntityFrameworkCore;
  using Microsoft.EntityFrameworkCore.Metadata;
  
  namespace Shizzle.Models
  {
      public partial class CatsDBContext : DbContext
      {
          public CatsDBContext()
          {
          }
  
          public CatsDBContext(DbContextOptions&lt;CatsDBContext&gt; options)
              : base(options)
          {
          }
  </code></pre>
  <p>Any ideas would be amazing...
  Thanks</p>