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
> 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.
54
54
55
55
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.
> 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.
59
59
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.
61
61
62
62
1. Provide the following information at the CLI or Cloud Shell's request:
Copy file name to clipboardExpand all lines: articles/service-connector/quickstart-portal-container-apps.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ ms.date: 10/22/2024
9
9
#Customer intent: As an app developer, I want to connect Azure Container Apps to a storage account in the Azure portal using Service Connector.
10
10
---
11
11
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)
13
13
14
14
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.
15
15
@@ -30,7 +30,7 @@ This quickstart shows you how to connect Azure Container Apps to other Cloud res
30
30
31
31
Sign in to the Azure portal at [https://portal.azure.com/](https://portal.azure.com/) with your Azure account.
32
32
33
-
## Create a new service connection
33
+
## Create a new service connection (preview)
34
34
35
35
Use Service Connector to create a new service connection in Container Apps.
Copy file name to clipboardExpand all lines: articles/service-connector/tutorial-java-jboss-connect-managed-identity-mysql-database.md
+54-51Lines changed: 54 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
-
title: 'Tutorial: Access data with managed identity in Java JBoss EAP'
2
+
title: Access data with managed identity in Java JBoss EAP
3
3
description: Secure Azure Database for MySQL connectivity with managed identity from a sample Java JBoss EAP app, and apply it to other Azure services.
# 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](/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:
16
18
17
19
> [!div class="checklist"]
18
20
> * Create a MySQL database.
@@ -42,18 +44,18 @@ cd Passwordless-Connections-for-Java-Apps/JakartaEE/jboss-eap/
42
44
43
45
## Create an Azure Database for MySQL
44
46
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.
46
48
47
49
1. Sign into the Azure CLI, and optionally set your subscription if you have more than one connected to your login credentials.
48
50
49
-
```azurecli-interactive
51
+
```azurecli
50
52
az login
51
53
az account set --subscription <subscription-ID>
52
54
```
53
55
54
-
1. Create an Azure Resource Group, noting the resource group name.
56
+
1. Create an Azure resource group.
55
57
56
-
```azurecli-interactive
58
+
```azurecli
57
59
export RESOURCE_GROUP=<resource-group-name>
58
60
export LOCATION=eastus
59
61
@@ -64,6 +66,7 @@ Follow these steps to create an Azure Database for MySQL in your subscription. T
64
66
65
67
```azurecli-interactive
66
68
export MYSQL_ADMIN_USER=azureuser
69
+
67
70
# MySQL admin access rights won't be used because Azure AD authentication is leveraged to administer the database.
68
71
export MYSQL_ADMIN_PASSWORD=<admin-password>
69
72
export MYSQL_HOST=<mysql-host-name>
@@ -99,6 +102,7 @@ Create an Azure App Service resource on Linux. JBoss EAP requires Premium SKU.
99
102
```azurecli-interactive
100
103
export APPSERVICE_PLAN=<app-service-plan>
101
104
export APPSERVICE_NAME=<app-service-name>
105
+
102
106
# Create an App Service plan
103
107
az appservice plan create \
104
108
--resource-group $RESOURCE_GROUP \
@@ -119,49 +123,48 @@ az webapp create \
119
123
120
124
Next, connect the database using [Service Connector](../service-connector/overview.md).
121
125
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).
> 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.
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).
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.
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
+
165
168
## Deploy the application
166
169
167
170
Follow these steps to prepare data in a database and deploy the application.
0 commit comments