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
# Tutorial: Connect to a PostgreSQL Database from Java Tomcat App Service without secrets using a managed identity
13
13
14
-
[Azure App Service](overview.md) provides a highly scalable, self-patching web hosting service in Azure. It also provides a [managed identity](overview-managed-identity.md) for your app, which is a turn-key solution for securing access to [Azure Database for PostgreSQL](../postgresql/index.yml) and other Azure services. Managed identities in App Service make your app more secure by eliminating secrets from your app, such as credentials in the environment variables. In this tutorial, you will learn how to:
14
+
[Azure App Service](overview.md) provides a highly scalable, self-patching web hosting service in Azure. It also provides a [managed identity](overview-managed-identity.md) for your app, which is a turn-key solution for securing access to [Azure Database for PostgreSQL](../postgresql/index.yml) and other Azure services. Managed identities in App Service make your app more secure by eliminating secrets from your app, such as credentials in the environment variables. In this tutorial, you learn how to:
15
15
16
16
> [!div class="checklist"]
17
17
> * Create a PostgreSQL database.
@@ -39,7 +39,7 @@ cd Passwordless-Connections-for-Java-Apps/Tomcat/
39
39
40
40
## Create an Azure Database for PostgreSQL
41
41
42
-
Follow these steps to create an Azure Database for Postgres in your subscription. The Spring Boot app will connect to this database and store its data when running, persisting the application state no matter where you run the application.
42
+
Follow these steps to create an Azure Database for Postgres in your subscription. The Spring Boot app connects to this database and store its data when running, persisting the application state no matter where you run the application.
43
43
44
44
1. Sign into the Azure CLI, and optionally set your subscription if you have more than one connected to your login credentials.
45
45
@@ -57,7 +57,7 @@ Follow these steps to create an Azure Database for Postgres in your subscription
57
57
az group create --name $RESOURCE_GROUP --location $LOCATION
58
58
```
59
59
60
-
1. Create an Azure Database for PostgreSQL server. The server is created with an administrator account, but it won't be used because we'll use the Azure Active Directory (Azure AD) admin account to perform administrative tasks.
60
+
1. Create an Azure Database for PostgreSQL server. The server is created with an administrator account, but it isn't used because we're going to use the Azure Active Directory (Azure AD) admin account to perform administrative tasks.
61
61
62
62
### [Flexible Server](#tab/flexible)
63
63
@@ -176,7 +176,7 @@ Then, connect your app to a Postgres database with a system-assigned managed ide
176
176
177
177
### [Flexible Server](#tab/flexible)
178
178
179
-
To do this, run the [az webapp connection create](/cli/azure/webapp/connection/create#az-webapp-connection-create-postgres-flexible) command.
179
+
To make this connection, run the [az webapp connection create](/cli/azure/webapp/connection/create#az-webapp-connection-create-postgres-flexible) command.
180
180
181
181
```azurecli-interactive
182
182
az webapp connection create postgres-flexible \
@@ -191,7 +191,7 @@ az webapp connection create postgres-flexible \
191
191
192
192
### [Single Server](#tab/single)
193
193
194
-
To do this, run the [az webapp connection create](/cli/azure/webapp/connection/create#az-webapp-connection-create-postgres) command.
194
+
To make this connection, run the [az webapp connection create](/cli/azure/webapp/connection/create#az-webapp-connection-create-postgres) command.
# Tutorial: Connect to a MySQL Database from Java JBoss EAP App Service with passwordless connection
14
14
15
-
[Azure App Service](../app-service/overview.md) provides a highly scalable, self-patching web hosting service in Azure. It also provides a [managed identity](../app-service/overview-managed-identity.md) for your app, which is a turn-key solution for securing access to [Azure Database for MySQL](../mysql/index.yml) and other Azure services. Managed identities in App Service make your app more secure by eliminating secrets from your app, such as credentials in the environment variables. In this tutorial, you will learn how to:
15
+
[Azure App Service](../app-service/overview.md) provides a highly scalable, self-patching web hosting service in Azure. It also provides a [managed identity](../app-service/overview-managed-identity.md) for your app, which is a turn-key solution for securing access to [Azure Database for MySQL](../mysql/index.yml) and other Azure services. Managed identities in App Service make your app more secure by eliminating secrets from your app, such as credentials in the environment variables. In this tutorial, you learn how to:
16
16
17
17
> [!div class="checklist"]
18
18
> * Create a MySQL database.
@@ -42,7 +42,7 @@ cd Passwordless-Connections-for-Java-Apps/JakartaEE/jboss-eap/
42
42
43
43
## Create an Azure Database for MySQL
44
44
45
-
Follow these steps to create an Azure Database for MySQL in your subscription. The Spring Boot app will connect to this database and store its data when running, persisting the application state no matter where you run the application.
45
+
Follow these steps to create an Azure Database for MySQL in your subscription. The Spring Boot app connects to this database and store its data when running, persisting the application state no matter where you run the application.
46
46
47
47
1. Sign into the Azure CLI, and optionally set your subscription if you have more than one connected to your login credentials.
48
48
@@ -60,7 +60,7 @@ Follow these steps to create an Azure Database for MySQL in your subscription. T
60
60
az group create --name $RESOURCE_GROUP --location $LOCATION
61
61
```
62
62
63
-
1. Create an Azure Database for MySQL server. The server is created with an administrator account, but it won't be used because we'll use the Azure Azure AD admin account to perform administrative tasks.
63
+
1. Create an Azure Database for MySQL server. The server is created with an administrator account, but it isn't used because we're going to use the Azure AD admin account to perform administrative tasks.
> After creating the user-assigned identity, ask your *Global Administrator* or *Privileged Role Administrator* to grant the following permissions for this identity: `User.Read.All`, `GroupMember.Read.All`, and `Application.Read.ALL`. For more information, see the [Permissions](/azure/mysql/flexible-server/concepts-azure-ad-authentication#permissions) section of [Active Directory authentication](/azure/mysql/flexible-server/concepts-azure-ad-authentication).
141
141
142
-
Then, connect your app to a MySQL database with a system-assigned managed identity using Service Connector.
143
-
144
-
To do this, run the [az webapp connection create](/cli/azure/webapp/connection/create#az-webapp-connection-create-mysql-flexible) command.
142
+
Then, connect your app to a MySQL database with a system-assigned managed identity using Service Connector. To make this connection, run the [az webapp connection create](/cli/azure/webapp/connection/create#az-webapp-connection-create-mysql-flexible) command.
145
143
146
144
```azurecli-interactive
147
145
az webapp connection create mysql-flexible \
@@ -154,12 +152,12 @@ az webapp connection create mysql-flexible \
154
152
--client-type java
155
153
```
156
154
157
-
This Service Connector command will do the following tasks in the background:
155
+
This Service Connector command does the following tasks in the background:
158
156
159
157
* Enable system-assigned managed identity for the app `$APPSERVICE_NAME` hosted by Azure App Service.
160
158
* Set the Azure Active Directory admin to the current signed-in user.
161
-
* Add a database user for the system-assigned managed identity in step 1 and grant all privileges of the database `$DATABASE_NAME` to this user. The user name can be get from the connection string in above command output
162
-
* Add a connection string to App Settings in the app named `AZURE_MYSQL_CONNECTIONSTRING`
159
+
* Add a database user for the system-assigned managed identity in step 1 and grant all privileges of the database `$DATABASE_NAME` to this user. You can get the user name from the connection string in the output from the previous command.
160
+
* Add a connection string to App Settings in the app named `AZURE_MYSQL_CONNECTIONSTRING`.
163
161
164
162
> [!NOTE]
165
163
> If you see the error message `The subscription is not registered to use Microsoft.ServiceLinker`, run the command `az provider register --namespace Microsoft.ServiceLinker` to register the Service Connector resource provider, then run the connection command again.
@@ -208,7 +206,7 @@ Follow these steps to prepare data in a database and deploy the application.
208
206
209
207
1. Update the connection string in App Settings.
210
208
211
-
Get the connection string generated by Service Connector and add passwordless authentication plugin. This connection string will be referenced in the startup script.
209
+
Get the connection string generated by Service Connector and add passwordless authentication plugin. This connection string is referenced in the startup script.
0 commit comments