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
+14-10Lines changed: 14 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,7 +112,7 @@ Having issues? Check the [Troubleshooting section](#troubleshooting).
112
112
113
113
::: zone pivot="azure-portal"
114
114
115
-
## 1. Create App Service, database, and cache
115
+
## 2. Create App Service, database, and cache
116
116
117
117
In this step, you create the Azure resources. The steps used in this tutorial create a set of secure-by-default resources that include App Service, Azure SQL Database, and Azure Cache. For the creation process, you'll specify:
118
118
@@ -176,9 +176,12 @@ Sign in to the [Azure portal](https://portal.azure.com/) and follow these steps
176
176
177
177
The creation wizard generated the connectivity string for you already as [.NET connection strings](configure-common.md#configure-connection-strings) and [app settings](configure-common.md#configure-app-settings). However, the security best practice is to keep secrets out of App Service completely. You'll move your secrets to key vault and change your app setting to [Key Vault references](app-service-key-vault-references.md) with the help of Service Connectors.
178
178
179
+
> [!TIP]
180
+
> To use passwordless authentication, see [How do I change the SQL Database connection to use a managed identity instead?](#how-do-i-change-the-sql-database-connection-to-use-a-managed-identity-instead)
181
+
179
182
:::row:::
180
183
:::column span="2":::
181
-
**Step 1:** In the App Service page,
184
+
**Step 1:** In the App Service page:
182
185
1. In the left menu, select **Settings > Environment variables > Connection strings**.
183
186
1. Select **AZURE_SQL_CONNECTIONSTRING**.
184
187
1. In **Add/Edit connection string**, in the **Value** field, find the *Password=* part at the end of the string.
@@ -229,6 +232,7 @@ The creation wizard generated the connectivity string for you already as [.NET c
229
232
1. In the App Service page, in the left menu, select **Settings > Service Connector**. There are already two connectors, which the app creation wizard created for you.
230
233
1. Select checkbox next to the SQL Database connector, then select **Edit**.
231
234
1. Select the **Authentication** tab.
235
+
1. In **Password**, paste the password you copied earlier.
232
236
1. Select **Store Secret in Key Vault**.
233
237
1. Under **Key Vault Connection**, select **Create new**.
234
238
A **Create connection** dialog is opened on top of the edit dialog.
@@ -277,7 +281,7 @@ The creation wizard generated the connectivity string for you already as [.NET c
277
281
:::row-end:::
278
282
:::row:::
279
283
:::column span="2":::
280
-
**Step 8:** To verify that your changes:
284
+
**Step 8:** To verify your changes:
281
285
1. From the left menu, select **Environment variables > Connection strings** again.
282
286
1. Next to **AZURE_SQL_CONNECTIONSTRING**, select **Show value**. The value should be `@Microsoft.KeyValut(...)`, which means that it's a [key vault reference](app-service-key-vault-references.md) because the secret is now managed in the key vault.
283
287
1. To verify the Redis connection string, select the **App setting** tab. Next to **AZURE_REDIS_CONNECTIONSTRING**, select **Show value**. The value should be `@Microsoft.KeyValut(...)` too.
@@ -287,7 +291,7 @@ The creation wizard generated the connectivity string for you already as [.NET c
287
291
:::column-end:::
288
292
:::row-end:::
289
293
290
-
## 3. Deploy sample code
294
+
## 4. Deploy sample code
291
295
292
296
In this step, you configure GitHub deployment using GitHub Actions. It's just one of many ways to deploy to App Service, but also a great way to have continuous integration in your deployment process. By default, every `git push` to your GitHub repository kicks off the build and deploy action.
293
297
@@ -406,7 +410,7 @@ In this step, you configure GitHub deployment using GitHub Actions. It's just on
406
410
:::column-end:::
407
411
:::row-end:::
408
412
409
-
## 4. Generate database schema
413
+
## 5. Generate database schema
410
414
411
415
With the SQL Database protected by the virtual network, the easiest way to run [dotnet database migrations](/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli) is in an SSH session with the App Service container.
412
416
@@ -433,7 +437,7 @@ In the SSH session, only changes to files in `/home` can persist beyond app rest
433
437
434
438
Having issues? Check the [Troubleshooting section](#troubleshooting).
435
439
436
-
## 5. Browse to the app
440
+
## 6. Browse to the app
437
441
438
442
:::row:::
439
443
:::column span="2":::
@@ -458,7 +462,7 @@ Having issues? Check the [Troubleshooting section](#troubleshooting).
458
462
> [!TIP]
459
463
> The sample application implements the [cache-aside](/azure/architecture/patterns/cache-aside) pattern. When you visit a data view for the second time, or reload the same page after making data changes, **Processing time** in the webpage shows a much faster time because it's loading the data from the cache instead of the database.
460
464
461
-
## 6. Stream diagnostic logs
465
+
## 7. Stream diagnostic logs
462
466
463
467
Azure App Service captures all messages logged to the console to assist you in diagnosing issues with your application. The sample app outputs console log messages in each of its endpoints to demonstrate this capability.
464
468
@@ -481,7 +485,7 @@ Azure App Service captures all messages logged to the console to assist you in d
481
485
:::column-end:::
482
486
:::row-end:::
483
487
484
-
## 7. Clean up resources
488
+
## 8. Clean up resources
485
489
486
490
When you're finished, you can delete all of the resources from your Azure subscription by deleting the resource group.
487
491
@@ -550,7 +554,7 @@ The dev container already has the [Azure Developer CLI](/azure/developer/azure-d
550
554
azd up
551
555
```
552
556
553
-
The `azd up`command takes about 15 minutes to complete (the Redis cache take the most time). It also compiles and deploys your application code, but you'll modify your code later to work with App Service. While it's running, the command provides messages about the provisioning and deployment process, including a link to the deployment in Azure. When it finishes, the command also displays a link to the deploy application.
557
+
The `azd up`command takes about 15 minutes to complete (the Redis cache takes the most time). It also compiles and deploys your application code, but you'll modify your code later to work with App Service. While it's running, the command provides messages about the provisioning and deployment process, including a link to the deployment in Azure. When it finishes, the command also displays a link to the deploy application.
554
558
555
559
This AZD template contains files (*azure.yaml* and the *infra* directory) that generate a secure-by-default architecture with the following Azure resources:
556
560
@@ -632,7 +636,7 @@ Before you deploy these changes, you still need to generate a migration bundle.
632
636
633
637
Having issues? Check the [Troubleshooting section](#troubleshooting).
634
638
635
-
## 4. Generate database schema
639
+
## 5. Generate database schema
636
640
637
641
With the SQL Database protected by the virtual network, the easiest way to run database migrations is in an SSH session with the App Service container. However, the App Service Linux containers don't have the .NET SDK, so the easiest way to run database migrations is to upload a self-contained migrations bundle.
Copy file name to clipboardExpand all lines: articles/app-service/tutorial-java-spring-cosmosdb.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -157,6 +157,7 @@ Sign in to the [Azure portal](https://portal.azure.com/) and follow these steps
157
157
- **App Service**: Represents your app and runs in the App Service plan.
158
158
- **Virtual network**: Integrated with the App Service app and isolates back-end network traffic.
159
159
- **Azure Cosmos DB**: Accessible only from behind its private endpoint. A database is created for you on the database account.
160
+
- **Private endpoints**: Access endpoints for the database server and the Redis cache in the virtual network.
160
161
- **Private DNS zones**: Enable DNS resolution of the database server and the Redis cache in the virtual network.
161
162
:::column-end:::
162
163
:::column:::
@@ -172,7 +173,7 @@ The creation wizard generated the connectivity string for you already as an [app
172
173
173
174
:::row:::
174
175
:::column span="2":::
175
-
**Step 1:** In the App Service page,
176
+
**Step 1:** In the App Service page:
176
177
1. In the left menu, select **Settings > Environment variables**.
177
178
1. Next to **AZURE_COSMOS_CONNECTIONSTRING**, select **Show value**.
178
179
This connection string lets you connect to the Cosmos DB database secured behind a private endpoint. However, the secret is saved directly in the App Service app, which isn't the best. You'll change this.
@@ -255,7 +256,7 @@ The creation wizard generated the connectivity string for you already as an [app
255
256
:::row-end:::
256
257
:::row:::
257
258
:::column span="2":::
258
-
**Step 7:** To verify that you secured the secrets:
259
+
**Step 7:** To verify your changes:
259
260
1. From the left menu, select **Environment variables** again.
260
261
1. Make sure that the app setting **spring.data.mongodb.uri** exists. The default connector generated it for you, and your Spring Boot application already uses the variable.
261
262
1. Next to the app setting, select **Show value**. The value should be `@Microsoft.KeyValut(...)`, which means that it's a [key vault reference](app-service-key-vault-references.md) because the secret is now managed in the key vault.
@@ -321,7 +322,7 @@ Like the Tomcat convention, if you want to deploy to the root context of Tomcat,
321
322
:::column span="2":::
322
323
**Step 5 (Option 1: with GitHub Copilot):**
323
324
1. Start a new chat session by selecting the **Chat** view, then selecting **+**.
324
-
1. Ask, "*@workspacewhy do i get the error in GitHub actions: The string 'java21' is not valid SemVer notation for a Java version.*" Copilot might give you an explanation and even give you the link to the workflow file that you need to fix.
325
+
1. Ask, "*@workspaceWhy do I get the error in GitHub actions: The string 'java21' is not valid SemVer notation for a Java version.*" Copilot might give you an explanation and even give you the link to the workflow file that you need to fix.
325
326
1. Open *.github/workflows/starter-no-infra_msdocs-spring-cosmosdb-123.yaml* in the explorer and make the suggested fix.
326
327
GitHub Copilot doesn't give you the same response every time, you might need to ask more questions to fine-tune its response. For tips, see [What can I do with GitHub Copilot in my codespace?](#what-can-i-do-with-github-copilot-in-my-codespace).
327
328
:::column-end:::
@@ -497,7 +498,7 @@ The dev container already has the [Azure Developer CLI](/azure/developer/azure-d
497
498
azd up
498
499
```
499
500
500
-
The `azd up`command takes about 15 minutes to complete (the Redis cache take the most time). It also compiles and deploys your application code, but you'll modify your code later to work with App Service. While it's running, the command provides messages about the provisioning and deployment process, including a link to the deployment in Azure. When it finishes, the command also displays a link to the deploy application.
501
+
The `azd up`command takes about 15 minutes to complete (the Redis cache takes the most time). It also compiles and deploys your application code, but you'll modify your code later to work with App Service. While it's running, the command provides messages about the provisioning and deployment process, including a link to the deployment in Azure. When it finishes, the command also displays a link to the deploy application.
501
502
502
503
This AZD template contains files (*azure.yaml* and the *infra* directory) that generate a secure-by-default architecture with the following Azure resources:
503
504
@@ -508,6 +509,7 @@ The dev container already has the [Azure Developer CLI](/azure/developer/azure-d
508
509
- **Azure Cosmos DB account with MongoDB API**: Accessible only from behind its private endpoint. A database is created for you on the server.
509
510
- **Azure Cache for Redis**: Accessible only from within the virtual network.
510
511
- **Key vault**: Accessible only from behind its private endpoint. Used to manage secrets for the App Service app.
512
+
- **Private endpoints**: Access endpoints forthe key vault, the database server, and the Redis cachein the virtual network.
511
513
- **Private DNS zones**: Enable DNS resolution of the Cosmos DB database, the Redis cache, and the key vault in the virtual network.
512
514
- **Log Analytics workspace**: Acts as the target container for your app to ship its logs, where you can also query the logs.
0 commit comments