Skip to content

Commit ab922dd

Browse files
Update tutorial-dotnetcore-sqldb-app.md
Startup.cs was using the wrong app settings name
1 parent 69bd6dd commit ab922dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

articles/app-service/tutorial-dotnetcore-sqldb-app.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,11 @@ Next, update the name of the connection string in `appsettings.json` file to mat
203203
}
204204
```
205205

206-
Next, update the `Startup.cs` file the sample project by updating the existing connection string name `MyDbConnection` to `AZURE_SQL_CONNECTIONSTRING`. This change configures the `DbContext` to use the correct connection string in Azure and locally from the `appsettings.json` file.
206+
Next, update the `Startup.cs` file the sample project by updating the existing connection string name `MyDbConnection` to `AZURE_SQL_CONNECTION`. This change configures the `DbContext` to use the correct connection string in Azure and locally from the `appsettings.json` file.
207207

208208
```csharp
209209
services.AddDbContext<MyDatabaseContext>(options =>
210-
options.UseSqlServer(Configuration.GetConnectionString("AZURE_SQL_CONNECTIONSTRING")));
210+
options.UseSqlServer(Configuration.GetConnectionString("AZURE_SQL_CONNECTION")));
211211
```
212212

213213
From a local terminal, run the following commands to install the necessary CLI tools for Entity Framework Core, create an initial database migration file, and apply those changes to update the database. Make sure to pass in the connection string value you copied from the Azure SQL database for the `connection` parameter. The `connection` parameter overrides the value of the connection string that is configured for the `DbContext` in the `startup.cs` file.

0 commit comments

Comments
 (0)