You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service/tutorial-dotnetcore-sqldb-app.md
+30-30Lines changed: 30 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,10 +60,10 @@ Next, create an App Service plan using the [az appservice plan create](/cli/azur
60
60
61
61
```azurecli-interactive
62
62
63
-
# Change 123 to any three characters to form a unique name across Azure
64
-
az appservice plan create
65
-
--name msdocs-core-sql-plan-123
66
-
--resource-group msdocs-core-sql
63
+
# Change 123 to any three characters to form a unique name
64
+
az appservice plan create \
65
+
--name msdocs-core-sql-plan-123 \
66
+
--resource-group msdocs-core-sql \
67
67
--sku F1
68
68
```
69
69
@@ -74,10 +74,10 @@ Finally, create the App Service web app using the [az webapp create](/cli/azure/
74
74
75
75
```azurecli-interactive
76
76
77
-
az webapp create
78
-
--name <your-app-service-name>
79
-
--runtime "DOTNET|6.0"
80
-
--plan <your-app-service-plan-name>
77
+
az webapp create \
78
+
--name <your-app-service-name> \
79
+
--runtime "DOTNET|6.0" \
80
+
--plan <your-app-service-plan-name> \
81
81
--resource-group msdocs-core-sql
82
82
```
83
83
@@ -108,31 +108,31 @@ To create an Azure SQL database, we first must create a SQL Server to host it. A
108
108
Replace the *server-name* placeholder with a unique SQL Database name. This name is used as the part of the globally unique SQL Database endpoint. Also, replace *db-username* and *db-username* with a username and password of your choice.
109
109
110
110
```azurecli-interactive
111
-
az sql server create
112
-
--location eastus
113
-
--resource-group msdocs-core-sql
114
-
--name <server-name>
115
-
--admin-user <db-username>
111
+
az sql server create \
112
+
--location eastus \
113
+
--resource-group msdocs-core-sql \
114
+
--name <server-name> \
115
+
--admin-user <db-username> \
116
116
--admin-password <db-password>
117
117
```
118
118
119
119
Provisioning a SQL Server may take a few minutes. Once the resource is available, we can create a database with the [az sql db create](/cli/azure/sql/db#az_sql_db_create) command.
120
120
121
121
```azurecli-interactive
122
-
az sql db create
123
-
--resource-group msdocs-core-sql
124
-
--server <server-name>
122
+
az sql db create \
123
+
--resource-group msdocs-core-sql \
124
+
--server <server-name> \
125
125
--name coreDb
126
126
```
127
127
128
128
We also need to add the following firewall rule to our database server to allow other Azure resources to access it.
129
129
130
130
```azurecli-interactive
131
-
az sql server firewall-rule create
132
-
--resource-group msdocs-core-sql
133
-
--server <server-name>
134
-
--name AzureAccess
135
-
--start-ip-address 0.0.0.0
131
+
az sql server firewall-rule create \
132
+
--resource-group msdocs-core-sql \
133
+
--server <server-name> \
134
+
--name AzureAccess \
135
+
--start-ip-address 0.0.0.0 \
136
136
--end-ip-address 0.0.0.0
137
137
```
138
138
@@ -187,9 +187,9 @@ Azure CLI commands can be run in the [Azure Cloud Shell](https://shell.azure.com
187
187
We can retrieve the Connection String for our database using the [az sql db show-connection-string](/cli/azure/sql/db#az_sql_db_show_connection_string) command. This command allows us to add the Connection String to our App Service configuration settings. Copy this Connection String value for later use.
188
188
189
189
```azurecli-interactive
190
-
az sql db show-connection-string
191
-
--client ado.net
192
-
--name coreDb
190
+
az sql db show-connection-string \
191
+
--client ado.net \
192
+
--name coreDb \
193
193
--server <your-server-name>
194
194
```
195
195
@@ -198,10 +198,10 @@ Next, let's assign the Connection String to our App Service using the command be
198
198
Make sure to replace the username and password in the connection string with your own before running the command.
@@ -247,8 +247,8 @@ Next we need to update the appsettings.json file in our local app code with the
247
247
Finally, run the commands below to install the necessary CLI tools for Entity Framework Core, create an initial database migration file, and apply those changes to update the database.
0 commit comments