I am currently connecting to a SQL db deployed to azure via a connection string in the constructor of my DBContext class, like so :
public class ImageContext : DbContext
{
public ImageContext() : base("Data Source=tcp:example.database.windows.net,1433;Initial Catalog=example;User Id=exampleacc@example.database.windows.net;Password=example")
{
}
public DbSet<item1> item1 { get; set; }
public DbSet<item2> item2 { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
}
}
I recognize this as a bad practice because I have my username and password as plain text in the source code. Can someone please point me in the right direction to connect to this DB safely?