I am trying to deploy my Web API to an Azure App Service using Visual Studio 2022, however when I try to apply the migrations, it is not discovering the connection string although it discovers the database context:
This is the code of my database context class:
namespace MyPortfolioWebAPI.Data
{
public class MyPortfolioContext:DbContext
{
public MyPortfolioContext(DbContextOptions<MyPortfolioContext> options) : base(options)
{
}
public DbSet<Emails> Emails { get; set; } = null!;
public DbSet<Projects> Projects { get; set; } = null!;
}
}
This is my appsettings.json
file:
It works fine on my local machine, however I am trying to publish it to Azure.