Skip to content

Commit ab7f305

Browse files
authored
Merge pull request #227443 from maud-lv/ml-sc-passwordlessfeb
Add new extension for passwordless connections
2 parents 5e6e188 + f39ee92 commit ab7f305

File tree

3 files changed

+57
-40
lines changed

3 files changed

+57
-40
lines changed

articles/app-service/tutorial-java-tomcat-connect-managed-identity-postgresql-database.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ms.custom: passwordless-java, service-connector
2626
* [Git](https://git-scm.com/)
2727
* [Java JDK](/azure/developer/java/fundamentals/java-support-on-azure)
2828
* [Maven](https://maven.apache.org)
29-
* [Azure CLI](/cli/azure/install-azure-cli) version 2.41.0 or higher.
29+
* [Azure CLI](/cli/azure/install-azure-cli) version 2.45.0 or higher.
3030

3131
## Clone the sample app and prepare the repo
3232

@@ -164,12 +164,17 @@ Follow these steps to build a WAR file and deploy to Azure App Service on Tomcat
164164

165165
## Connect the Postgres database with identity connectivity
166166

167-
### [Flexible Server](#tab/flexible)
167+
Next, connect the database using [Service Connector](../service-connector/overview.md).
168+
169+
Install the Service Connector passwordless extension for the Azure CLI:
168170

169-
> [!NOTE]
170-
> Azure Active Directory Authentication for PostgreSQL Flexible Server is currently in preview.
171+
```azurecli
172+
az extension add --name serviceconnector-passwordless --upgrade
173+
```
171174

172-
Next, connect your app to a Postgres database with a system-assigned managed identity using Service Connector.
175+
Then, connect your app to a Postgres database with a system-assigned managed identity using Service Connector.
176+
177+
### [Flexible Server](#tab/flexible)
173178

174179
To do this, run the [az webapp connection create](/cli/azure/webapp/connection/create#az-webapp-connection-create-postgres-flexible) command.
175180

articles/container-apps/tutorial-java-quarkus-connect-managed-identity-postgresql-database.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ ms.custom: devx-track-java, devx-track-javaee, devx-track-javaee-quarkus, passwo
1616

1717
This tutorial walks you through the process of building, configuring, deploying, and scaling Java container apps on Azure. At the end of this tutorial, you'll have a [Quarkus](https://quarkus.io) application storing data in a [PostgreSQL](../postgresql/index.yml) database with a managed identity running on [Container Apps](overview.md).
1818

19-
> [!NOTE]
20-
> Azure Active Directory Authentication for PostgreSQL Flexible Server is currently in preview.
21-
2219
What you will learn:
2320

2421
> [!div class="checklist"]
@@ -32,7 +29,7 @@ What you will learn:
3229

3330
## 1. Prerequisites
3431

35-
* [Azure CLI](/cli/azure/install-azure-cli) version 2.41.0 or higher.
32+
* [Azure CLI](/cli/azure/install-azure-cli) version 2.45.0 or higher.
3633
* [Git](https://git-scm.com/)
3734
* [Java JDK](/azure/developer/java/fundamentals/java-support-on-azure)
3835
* [Maven](https://maven.apache.org)
@@ -345,6 +342,12 @@ Next, create a PostgreSQL Database and configure your container app to connect t
345342
--name fruits
346343
```
347344

345+
1. Install the [Service Connector](../service-connector/overview.md) passwordless extension for the Azure CLI:
346+
347+
```azurecli
348+
az extension add --name serviceconnector-passwordless --upgrade
349+
```
350+
348351
1. Connect the database to the container app with a system-assigned managed identity, using the connection command.
349352

350353
### [Flexible Server](#tab/flexible)

articles/spring-apps/how-to-bind-postgres.md

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ With Azure Spring Apps, you can bind select Azure services to your applications
2424

2525
* An application deployed to Azure Spring Apps. For more information, see [Quickstart: Deploy your first application to Azure Spring Apps](./quickstart.md).
2626
* An Azure Database for PostgreSQL Flexible Server instance.
27-
* [Azure CLI](/cli/azure/install-azure-cli) version 2.41.0 or higher.
27+
* [Azure CLI](/cli/azure/install-azure-cli) version 2.45.0 or higher.
2828

2929
## Prepare your Java project
3030

@@ -49,40 +49,49 @@ Use the following steps to prepare your project.
4949

5050
## Bind your app to the Azure Database for PostgreSQL instance
5151

52-
### [Using a passwordless connection with a managed identity for flexible server (Recommended)](#tab/Passwordlessflex)
52+
### [Using a passwordless connection with a managed identity for flexible server](#tab/Passwordlessflex)
5353

54-
Configure Azure Spring Apps to connect to the PostgreSQL Database with a system-assigned managed identity using the `az spring connection create` command.
54+
1. Install the [Service Connector](../service-connector/overview.md) passwordless extension for the Azure CLI:
5555

56-
> [!NOTE]
57-
> Azure Active Directory Authentication for PostgreSQL Flexible Server is currently in preview.
56+
```azurecli
57+
az extension add --name serviceconnector-passwordless --upgrade
58+
```
59+
60+
1. Configure Azure Spring Apps to connect to the PostgreSQL Database with a system-assigned managed identity using the `az spring connection create` command.
5861

59-
```azurecli
60-
az spring connection create postgres-flexible \
61-
--resource-group $SPRING_APP_RESOURCE_GROUP \
62-
--service $Spring_APP_SERVICE_NAME \
63-
--app $APP_NAME \
64-
--deployment $DEPLOYMENT_NAME \
65-
--target-resource-group $POSTGRES_RESOURCE_GROUP \
66-
--server $POSTGRES_SERVER_NAME \
67-
--database $DATABASE_NAME \
68-
--system-identity
69-
```
62+
```azurecli
63+
az spring connection create postgres-flexible \
64+
--resource-group $AZ_SPRING_APPS_RESOURCE_GROUP \
65+
--service $AZ_SPRING_APPS_SERVICE_INSTANCE_NAME \
66+
--app $APP_NAME \
67+
--deployment $DEPLOYMENT_NAME \
68+
--target-resource-group $POSTGRES_RESOURCE_GROUP \
69+
--server $POSTGRES_SERVER_NAME \
70+
--database $DATABASE_NAME \
71+
--system-identity
72+
```
7073

7174
### [Using a passwordless connection with a managed identity for single server](#tab/Passwordlesssingle)
7275

73-
Configure Azure Spring Apps to connect to the PostgreSQL Database with a system-assigned managed identity using the `az spring connection create` command.
76+
1. Install the [Service Connector](../service-connector/overview.md) passwordless extension for the Azure CLI:
77+
78+
```azurecli
79+
az extension add --name serviceconnector-passwordless --upgrade
80+
```
81+
82+
1. Configure Azure Spring Apps to connect to the PostgreSQL Database with a system-assigned managed identity using the `az spring connection create` command.
7483

75-
```azurecli
76-
az spring connection create postgres \
77-
--resource-group $SPRING_APP_RESOURCE_GROUP \
78-
--service $Spring_APP_SERVICE_NAME \
79-
--app $APP_NAME \
80-
--deployment $DEPLOYMENT_NAME \
81-
--target-resource-group $POSTGRES_RESOURCE_GROUP \
82-
--server $POSTGRES_SERVER_NAME \
83-
--database $DATABASE_NAME \
84-
--system-identity
85-
```
84+
```azurecli
85+
az spring connection create postgres \
86+
--resource-group $AZ_SPRING_APPS_RESOURCE_GROUP \
87+
--service $AZ_SPRING_APPS_SERVICE_INSTANCE_NAME \
88+
--app $APP_NAME \
89+
--deployment $DEPLOYMENT_NAME \
90+
--target-resource-group $POSTGRES_RESOURCE_GROUP \
91+
--server $POSTGRES_SERVER_NAME \
92+
--database $DATABASE_NAME \
93+
--system-identity
94+
```
8695

8796
### [Using admin credentials](#tab/Secrets)
8897

@@ -96,13 +105,13 @@ Use the following steps to bind your app.
96105

97106
```azurecli
98107
az spring connection create postgres \
99-
--resource-group $AZURE_SPRING_APPS_RESOURCE_GROUP \
100-
--service $AZURE_SPRING_APPS_SERVICE_INSTANCE_NAME \
108+
--resource-group $AZ_SPRING_APPS_RESOURCE_GROUP \
109+
--service $AZ_SPRING_APPS_SERVICE_INSTANCE_NAME \
101110
--app $APP_NAME \
102111
--deployment $DEPLOYMENT_NAME \
103112
--target-resource-group $POSTGRES_RESOURCE_GROUP \
104113
--server $POSTGRES_SERVER_NAME \
105-
--database testdb \
114+
--database $DATABASE_NAME \
106115
--secret name=$USERNAME secret=$PASSWORD
107116
```
108117

0 commit comments

Comments
 (0)