Skip to content

Commit 9ac6a73

Browse files
committed
connection string updates
1 parent 346392f commit 9ac6a73

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ To see the entirety of the command output, drop the `--query` in the command.
174174

175175
## 5 - Generate the Database Schema
176176

177-
To generate our database schema, set up a firewall rule on the SQL database server. This rule lets your local computer connect to Azure.
177+
To generate our database schema, set up a firewall rule on the SQL database server. This rule lets your local computer connect to Azure. For this step, you'll need to know your local computer's IP address. For more information about how to find the IP address, see here.
178178

179179
### [Azure portal](#tab/azure-portal)
180180

@@ -195,6 +195,15 @@ az sql server firewall-rule create --resource-group msdocs-core-sql --server <yo
195195

196196
---
197197

198+
Next, update the name of the connection string in appsettings.json file to match the `AZURE_SQL_CONNECTION` name generated by the service connector. When the app is deployed to Azure, the `LocalDb` connection string value will be overridden by the connection string stored in Azure.
199+
200+
```json
201+
"ConnectionStrings": {
202+
// This local connection will be overridden with an Azure connection string after deployment
203+
"AZURE_SQL_CONNECTION": "Server=(localdb)\\mssqllocaldb;Trusted_Connection=True;MultipleActiveResultSets=true"
204+
}
205+
```
206+
198207
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 you copied from the Azure SQL database for the `connection` parameter, which will override the `localdb` connection string in the `appsettings.json` file.
199208

200209
```dotnetcli

0 commit comments

Comments
 (0)