update variable
This commit is contained in:
@@ -23,10 +23,14 @@ var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Logging.AddConsole();
|
||||
|
||||
var azdTemplate= builder.Configuration["AZD_TEMPLATE"];
|
||||
var env = builder.Configuration["Environment"];
|
||||
|
||||
if (azdTemplate == "enable"){
|
||||
// Configure SQL Server (Azd template)
|
||||
if (env == "Local"){
|
||||
// Configure SQL Server (local)
|
||||
Microsoft.eShopWeb.Infrastructure.Dependencies.ConfigureServices(builder.Configuration, builder.Services);
|
||||
}
|
||||
else{
|
||||
// Configure SQL Server (prod)
|
||||
var credential = new ChainedTokenCredential(new AzureDeveloperCliCredential(), new DefaultAzureCredential());
|
||||
builder.Configuration.AddAzureKeyVault(new Uri(builder.Configuration["AZURE_KEY_VAULT_ENDPOINT"]), credential);
|
||||
builder.Services.AddDbContext<CatalogContext>(c =>
|
||||
@@ -40,10 +44,6 @@ if (azdTemplate == "enable"){
|
||||
options.UseSqlServer(connectionString, sqlOptions => sqlOptions.EnableRetryOnFailure());
|
||||
});
|
||||
}
|
||||
else{
|
||||
// Configure SQL Server (Locally)
|
||||
Microsoft.eShopWeb.Infrastructure.Dependencies.ConfigureServices(builder.Configuration, builder.Services);
|
||||
}
|
||||
|
||||
builder.Services.AddCookieSettings();
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"IdentityConnection": "Server=(localdb)\\mssqllocaldb;Integrated Security=true;Initial Catalog=Microsoft.eShopOnWeb.Identity;"
|
||||
},
|
||||
"CatalogBaseUrl": "",
|
||||
"Environment": "Local",
|
||||
"Logging": {
|
||||
"IncludeScopes": false,
|
||||
"LogLevel": {
|
||||
|
||||
Reference in New Issue
Block a user