Skip to content

Commit bc99374

Browse files
committed
PR update
1 parent 17599ff commit bc99374

File tree

4 files changed

+61
-58
lines changed

4 files changed

+61
-58
lines changed

articles/service-connector/quickstart-cli-container-apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Create a connection using a managed identity or an access key.
5050
### [Managed identity](#tab/using-managed-identity)
5151
5252
> [!IMPORTANT]
53-
> To use a managed identity, you must have the permission to modify [Microsoft Entra role assignment](/entra/identity/role-based-access-control/manage-roles-portal). Without this permission, your connection creation will fail. Ask your subscription owner to grant you this permission, or use an access key instead to create the connection.
53+
> To use a managed identity, you must have the permission to modify [Microsoft Entra role assignment](/entra/identity/role-based-access-control/manage-roles-portal). Ask your subscription owner to grant you this permission, or use an access key instead to create the connection.
5454
5555
1. Run the `az containerapp connection create` command to create a service connection from Container Apps to a Blob Storage with a system-assigned managed identity.
5656

articles/service-connector/quickstart-cli-spring-cloud-connection.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: Quickstart - Create a service connection in Azure Spring Apps with the Azure CLI
3-
description: Quickstart showing how to create a service connection in Azure Spring Apps with the Azure CLI
3+
description: In this step-by-step guide, learn how to create a service connection in Azure Spring Apps using the Azure CLI.
44
author: maud-lv
55
ms.author: malev
66
ms.service: service-connector
77
ms.topic: quickstart
8-
ms.date: 10/31/2022
8+
ms.date: 12/18/2024
99
ms.devlang: azurecli
1010
ms.custom: devx-track-azurecli, build-2024
1111
---
@@ -55,9 +55,9 @@ Create a connection from Azure Spring Apps using a managed identity or an access
5555
### [Managed identity](#tab/Using-Managed-Identity)
5656
5757
> [!IMPORTANT]
58-
> To use a managed identity, you must have the permission to modify [role assignments in Microsoft Entra ID](/entra/identity/role-based-access-control/manage-roles-portal). Without this permission, your connection creation will fail. Ask your subscription owner to grant you a role assignment permission or use an access key to create the connection.
58+
> To use a managed identity, you must have the permission to modify [role assignments in Microsoft Entra ID](/entra/identity/role-based-access-control/manage-roles-portal). Ask your subscription owner to grant you a role assignment permission or use an access key to create the connection.
5959
60-
1. Run the `az spring connection create` command to create a service connection to a Blob Storage with a system-assigned managed identity
60+
1. Run the `az spring connection create` command to connect application deployed to Azure Spring Apps to a Blob Storage resource, using a system-assigned managed identity.
6161
6262
1. Provide the following information at the CLI or Cloud Shell's request:
6363

articles/service-connector/quickstart-portal-container-apps.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.date: 10/22/2024
99
#Customer intent: As an app developer, I want to connect Azure Container Apps to a storage account in the Azure portal using Service Connector.
1010
---
1111

12-
# Quickstart: Create a service connection in Azure Container Apps from the Azure portal
12+
# Quickstart: Create a service connection in Azure Container Apps from the Azure portal (preview)
1313

1414
This quickstart shows you how to connect Azure Container Apps to other Cloud resources using the Azure portal and Service Connector. Service Connector lets you quickly connect compute services to cloud services, while managing your connection's authentication and networking settings.
1515

@@ -30,7 +30,7 @@ This quickstart shows you how to connect Azure Container Apps to other Cloud res
3030

3131
Sign in to the Azure portal at [https://portal.azure.com/](https://portal.azure.com/) with your Azure account.
3232

33-
## Create a new service connection
33+
## Create a new service connection (preview)
3434

3535
Use Service Connector to create a new service connection in Container Apps.
3636

articles/service-connector/tutorial-java-jboss-connect-managed-identity-mysql-database.md

Lines changed: 54 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: 'Tutorial: Access data with managed identity in Java JBoss EAP'
2+
title: Access data with managed identity in Java JBoss EAP
33
description: Secure Azure Database for MySQL connectivity with managed identity from a sample Java JBoss EAP app, and apply it to other Azure services.
44
ms.devlang: java
55
ms.topic: tutorial
6-
ms.date: 08/14/2023
6+
ms.date: 12/18/2024
77
ms.service: service-connector
88
author: xfz11
99
ms.author: xiaofanzhou
@@ -12,7 +12,9 @@ ms.custom: passwordless-java, service-connector, devx-track-azurecli, devx-track
1212

1313
# Tutorial: Connect to a MySQL Database from Java JBoss EAP App Service with passwordless connection
1414

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](/azure/mysql/) 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+
[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](/azure/mysql/) 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.
16+
17+
In this tutorial, you learn how to:
1618

1719
> [!div class="checklist"]
1820
> * Create a MySQL database.
@@ -42,18 +44,18 @@ cd Passwordless-Connections-for-Java-Apps/JakartaEE/jboss-eap/
4244

4345
## Create an Azure Database for MySQL
4446

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.
47+
Follow these steps to create an Azure Database for MySQL resource 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.
4648

4749
1. Sign into the Azure CLI, and optionally set your subscription if you have more than one connected to your login credentials.
4850

49-
```azurecli-interactive
51+
```azurecli
5052
az login
5153
az account set --subscription <subscription-ID>
5254
```
5355

54-
1. Create an Azure Resource Group, noting the resource group name.
56+
1. Create an Azure resource group.
5557

56-
```azurecli-interactive
58+
```azurecli
5759
export RESOURCE_GROUP=<resource-group-name>
5860
export LOCATION=eastus
5961
@@ -64,6 +66,7 @@ Follow these steps to create an Azure Database for MySQL in your subscription. T
6466

6567
```azurecli-interactive
6668
export MYSQL_ADMIN_USER=azureuser
69+
6770
# MySQL admin access rights won't be used because Azure AD authentication is leveraged to administer the database.
6871
export MYSQL_ADMIN_PASSWORD=<admin-password>
6972
export MYSQL_HOST=<mysql-host-name>
@@ -99,6 +102,7 @@ Create an Azure App Service resource on Linux. JBoss EAP requires Premium SKU.
99102
```azurecli-interactive
100103
export APPSERVICE_PLAN=<app-service-plan>
101104
export APPSERVICE_NAME=<app-service-name>
105+
102106
# Create an App Service plan
103107
az appservice plan create \
104108
--resource-group $RESOURCE_GROUP \
@@ -119,49 +123,48 @@ az webapp create \
119123

120124
Next, connect the database using [Service Connector](../service-connector/overview.md).
121125

122-
Install the Service Connector passwordless extension for the Azure CLI:
123-
124-
```azurecli
125-
az extension add --name serviceconnector-passwordless --upgrade
126-
```
127-
128-
Then, use the following command to create a user-assigned managed identity for Microsoft Entra authentication. For more information, see [Set up Microsoft Entra authentication for Azure Database for MySQL - Flexible Server](/azure/mysql/flexible-server/how-to-azure-ad).
129-
130-
```azurecli
131-
export USER_IDENTITY_NAME=<your-user-assigned-managed-identity-name>
132-
export IDENTITY_RESOURCE_ID=$(az identity create \
133-
--name $USER_IDENTITY_NAME \
134-
--resource-group $RESOURCE_GROUP \
135-
--query id \
136-
--output tsv)
137-
```
138-
139-
> [!IMPORTANT]
140-
> 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-
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.
143-
144-
```azurecli-interactive
145-
az webapp connection create mysql-flexible \
146-
--resource-group $RESOURCE_GROUP \
147-
--name $APPSERVICE_NAME \
148-
--target-resource-group $RESOURCE_GROUP \
149-
--server $MYSQL_HOST \
150-
--database $DATABASE_NAME \
151-
--system-identity mysql-identity-id=$IDENTITY_RESOURCE_ID \
152-
--client-type java
153-
```
154-
155-
This Service Connector command does the following tasks in the background:
156-
157-
* Enable system-assigned managed identity for the app `$APPSERVICE_NAME` hosted by Azure App Service.
158-
* Set the Microsoft Entra admin to the current signed-in user.
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`.
161-
162-
> [!NOTE]
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.
164-
126+
1. Install the Service Connector passwordless extension for the Azure CLI:
127+
128+
```azurecli
129+
az extension add --name serviceconnector-passwordless --upgrade
130+
```
131+
132+
1. Create a user-assigned managed identity for Microsoft Entra authentication using the following command. For more information, see [Set up Microsoft Entra authentication for Azure Database for MySQL - Flexible Server](/azure/mysql/flexible-server/how-to-azure-ad).
133+
134+
```azurecli
135+
export USER_IDENTITY_NAME=<your-user-assigned-managed-identity-name>
136+
export IDENTITY_RESOURCE_ID=$(az identity create \
137+
--name $USER_IDENTITY_NAME \
138+
--resource-group $RESOURCE_GROUP \
139+
--query id \
140+
--output tsv)
141+
```
142+
143+
1. Ask your *Global Administrator* or *Privileged Role Administrator* to grant the following permissions to the new user-assigned 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).
144+
145+
1. 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.
146+
147+
```azurecli
148+
az webapp connection create mysql-flexible \
149+
--resource-group $RESOURCE_GROUP \
150+
--name $APPSERVICE_NAME \
151+
--target-resource-group $RESOURCE_GROUP \
152+
--server $MYSQL_HOST \
153+
--database $DATABASE_NAME \
154+
--system-identity mysql-identity-id=$IDENTITY_RESOURCE_ID \
155+
--client-type java
156+
```
157+
158+
This Service Connector command does the following tasks in the background:
159+
160+
* Enable system-assigned managed identity for the app `$APPSERVICE_NAME` hosted by Azure App Service.
161+
* Set the Microsoft Entra admin to the current signed-in user.
162+
* 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.
163+
* Add a connection string to App Settings in the app named `AZURE_MYSQL_CONNECTIONSTRING`.
164+
165+
> [!NOTE]
166+
> 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.
167+
165168
## Deploy the application
166169
167170
Follow these steps to prepare data in a database and deploy the application.
@@ -274,7 +277,7 @@ curl https://${WEBAPP_URL}/checklist/1
274277

275278
[!INCLUDE [cli-samples-clean-up](../../includes/cli-samples-clean-up.md)]
276279

277-
## Next steps
280+
## Next step
278281

279282
Learn more about running Java apps on App Service on Linux in the developer guide.
280283

0 commit comments

Comments
 (0)