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
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -176,6 +176,9 @@ 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)
@@ -102,7 +102,7 @@ Having issues? Check the [Troubleshooting section](#troubleshooting).
102
102
103
103
First, you create the Azure resources. The steps used in this tutorial create a set of secure-by-default resources that include App Service and Azure Database for MySQL. For the creation process, you specify:
104
104
105
-
* The **Name** for the web app. It's the name used as part of the DNS name for your app in the form of `https://<app-name>.azurewebsites.net`.
105
+
* The **Name** for the web app. It's used as part of the DNS name for your app in the form of `https://<app-name>-<hash>.<region>.azurewebsites.net`.
106
106
* The **Region** to run the app physically in the world. It's also used as part of the DNS name for your app.
107
107
* The **Runtime stack** for the app. It's where you select the version of Java to use for your app.
108
108
* The **Hosting plan** for the app. It's the pricing tier that includes the set of features and scaling capacity for your app.
@@ -145,8 +145,8 @@ Sign in to the [Azure portal](https://portal.azure.com/) and follow these steps
145
145
- **App Service plan**: Defines the compute resources for App Service. A Linux plan in the *Basic* tier is created.
146
146
- **App Service**: Represents your app and runs in the App Service plan.
147
147
- **Virtual network**: Integrated with the App Service app and isolates back-end network traffic.
148
-
- **Azure Database for MySQL flexible server**: Accessible only from behind its private endpoint. A database and a user are created for you on the server.
149
-
- **Private DNS zones**: Enable DNS resolution of the database server and the Redis cache in the virtual network.
148
+
- **Azure Database for MySQL flexible server**: Accessible only from the virtual network. A database and a user are created for you on the server.
149
+
- **Private DNS zones**: Enable DNS resolution of the database server in the virtual network.
150
150
:::column-end:::
151
151
:::column:::
152
152
:::image type="content" source="./media/tutorial-java-tomcat-mysql-app/azure-portal-create-app-mysql-3.png" alt-text="A screenshot showing the deployment process completed." lightbox="./media/tutorial-java-tomcat-mysql-app/azure-portal-create-app-mysql-3.png":::
@@ -261,7 +261,7 @@ Having issues? Check the [Troubleshooting section](#troubleshooting).
261
261
:::column span="2":::
262
262
**Step 2:**
263
263
1. In the **Application settings** tab of the **Configuration** page, find the app setting `AZURE_MYSQL_CONNECTIONSTRING`. The creation wizard created it for you.
264
-
1. If you want, you can select the **Edit** button to the right of each setting and see or copy its value, or select Add to add a variable to inject into your Tomcat container. If you add an app setting that contains a valid Oracle, SQL Server, PostgreSQL, or MySQL connection string, App Service adds it as a Java Naming and Directory Interface (JNDI) data source in the Tomcat server's *context.xml* file.
264
+
1. If you want, you can select the **Edit** button to the right of each setting and see or copy its value, or select **Add** to add a variable to inject into your Tomcat container.
265
265
:::column-end:::
266
266
:::column:::
267
267
:::image type="content" source="./media/tutorial-java-tomcat-mysql-app/azure-portal-get-connection-string-2.png" alt-text="A screenshot showing how to see the autogenerated connection string." lightbox="./media/tutorial-java-tomcat-mysql-app/azure-portal-get-connection-string-2.png":::
@@ -272,7 +272,7 @@ Having issues? Check the [Troubleshooting section](#troubleshooting).
272
272
273
273
## 4. Confirm JNDI data source
274
274
275
-
In this step, you use the SSH connection to the app container to verify the JNDI data source in the Tomcat server. In the process, you learn how to access the SSH shell for the Tomcat container.
275
+
If you add an app setting that contains a valid JDBC connection string for Oracle, SQL Server, PostgreSQL, or MySQL, App Service adds a Java Naming and Directory Interface (JNDI) data source for it in the Tomcat server's *context.xml* file. In this step, you use the SSH connection to the app container to verify the JNDI data source. In the process, you learn how to access the SSH shell for the Tomcat container.
276
276
277
277
:::row:::
278
278
:::column span="2":::
@@ -402,7 +402,7 @@ Having issues? Check the [Troubleshooting section](#troubleshooting).
402
402
:::column span="2":::
403
403
**Step 1:** In the App Service page:
404
404
1. From the left menu, select **Overview**.
405
-
1. Select the URL of your app. You can also navigate directly to `https://<app-name>.azurewebsites.net`.
405
+
1. Select the URL of your app.
406
406
:::column-end:::
407
407
:::column:::
408
408
:::image type="content" source="./media/tutorial-java-tomcat-mysql-app/azure-portal-browse-app-1.png" alt-text="A screenshot showing how to launch an App Service from the Azure portal." lightbox="./media/tutorial-java-tomcat-mysql-app/azure-portal-browse-app-1.png":::
@@ -506,7 +506,7 @@ The dev container already has the [Azure Developer CLI](/azure/developer/azure-d
506
506
|---------|---------|
507
507
|The current directory is not empty. Would you like to initialize a project here in'\<your-directory>'?|**Y**|
508
508
|What would you like to do with these files?|**Keep my existing files unchanged**|
509
-
|Enter a new environment name | Type a unique name. The AZD template uses this name as part of the DNS name of your web app in Azure (`<app-name>.azurewebsites.net`). Alphanumeric characters and hyphens are allowed. |
509
+
|Enter a new environment name | Type a unique name. The AZD template uses this name as part of the DNS name of your web app in Azure (`<app-name>-<hash>.azurewebsites.net`). Alphanumeric characters and hyphens are allowed. |
510
510
511
511
1. Sign into Azure by running the `azd auth login`command and following the prompt:
512
512
@@ -528,9 +528,10 @@ The dev container already has the [Azure Developer CLI](/azure/developer/azure-d
528
528
- **App Service plan**: Defines the compute resources forApp Service. A Linux planin the *B1* tier is created.
529
529
- **App Service**: Represents your app and runs in the App Service plan.
530
530
- **Virtual network**: Integrated with the App Service app and isolates back-end network traffic.
531
-
- **Azure Database for MySQL flexible server**: Accessible only from behind its private endpoint. A database is created for you on the server.
531
+
- **Azure Database for MySQL flexible server**: Accessible only from the virtual network through the DNS zone integration. A database is created for you on the server.
532
532
- **Azure Cache for Redis**: Accessible only from within the virtual network.
533
-
- **Private DNS zones**: Enable DNS resolution of the database server and the Redis cache in the virtual network.
533
+
- **Private endpoints**: Access endpoints forthe key vault and the Redis cachein the virtual network.
534
+
- **Private DNS zones**: Enable DNS resolution of the key vault, the database server, and the Redis cache in the virtual network.
534
535
- **Log Analytics workspace**: Acts as the target container for your app to ship its logs, where you can also query the logs.
535
536
- **Key vault**: Used to keep your database password the same when you redeploy with AZD.
536
537
@@ -540,13 +541,14 @@ Having issues? Check the [Troubleshooting section](#troubleshooting).
540
541
541
542
The AZD template you use generated the connectivity variables for you already as [app settings](configure-common.md#configure-app-settings) and outputs the them to the terminal for your convenience. App settings are one way to keep connection secrets out of your code repository.
542
543
543
-
1. In the AZD output, find the app setting `AZURE_MYSQL_CONNECTIONSTRING`. To keep secrets safe, only the setting names are displayed. They look like this in the AZD output:
544
+
1. In the AZD output, find the app setting `AZURE_MYSQL_CONNECTIONSTRING`. Only the setting names are displayed. They look like this in the AZD output:
544
545
545
546
<pre>
546
547
App Service app has the following connection strings:
547
-
548
548
- AZURE_MYSQL_CONNECTIONSTRING
549
549
- AZURE_REDIS_CONNECTIONSTRING
550
+
- AZURE_KEYVAULT_RESOURCEENDPOINT
551
+
- AZURE_KEYVAULT_SCOPE
550
552
</pre>
551
553
552
554
`AZURE_MYSQL_CONNECTIONSTRING` contains the connection string to the MySQL database in Azure. You need to use it in your code later.
@@ -564,7 +566,7 @@ In this step, you use the SSH connection to the app container to verify the JNDI
564
566
1. In the AZD output, find the URL forthe SSH session and navigate to itin the browser. It looks like this in the output:
565
567
566
568
<pre>
567
-
Open SSH session to App Service container at: https://<app-name>.scm.azurewebsites.net/webssh/host
569
+
Open SSH session to App Service container at: https://<app-name>-<hash>.scm.azurewebsites.net/webssh/host
568
570
</pre>
569
571
570
572
1. In the SSH terminal, run `cat /usr/local/tomcat/conf/context.xml`. You should see that a JNDI resource called `jdbc/AZURE_MYSQL_CONNECTIONSTRING_DS` was added. You'll use this data source later.
@@ -636,7 +638,7 @@ Having issues? Check the [Troubleshooting section](#troubleshooting).
0 commit comments