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
With Azure Spring Apps, you can bind select Azure services to your applications automatically, instead of having to configure your Spring Boot application manually. This article shows you how to bind your application to your Azure Database for PostgreSQL instance.
22
24
25
+
In this article, we include two authentication methods: Azure Active Directory (Azure AD) authentication and PostgreSQL authentication. The Passwordless tab shows the Azure AD authentication and the Password tab shows the PostgreSQL authentication.
26
+
27
+
Azure AD authentication is a mechanism for connecting to Azure Database for PostgreSQL using identities defined in Azure AD. With Azure AD authentication, you can manage database user identities and other Microsoft services in a central location, which simplifies permission management.
28
+
29
+
PostgreSQL authentication uses accounts stored in PostgreSQL. If you choose to use passwords as credentials for the accounts, these credentials are stored in the user table. Because these passwords are stored in PostgreSQL, you need to manage the rotation of the passwords by yourself.
30
+
31
+
::: zone pivot="postgresql-passwordless-flexible-server"
32
+
23
33
## Prerequisites
24
34
25
35
* An application deployed to Azure Spring Apps. For more information, see [Quickstart: Deploy your first application to Azure Spring Apps](./quickstart.md).
@@ -49,7 +59,7 @@ Use the following steps to prepare your project.
49
59
50
60
## Bind your app to the Azure Database for PostgreSQL instance
51
61
52
-
### [Service Connector for flexible server](#tab/Passwordlessflex)
::: zone pivot="postgresql-passwordless-single-server"
111
+
112
+
## Prerequisites
113
+
114
+
* An application deployed to Azure Spring Apps. For more information, see [Quickstart: Deploy your first application to Azure Spring Apps](./quickstart.md).
115
+
* An Azure Database for PostgreSQL Single Server instance.
116
+
*[Azure CLI](/cli/azure/install-azure-cli) version 2.45.0 or higher.
117
+
118
+
## Prepare your Java project
119
+
120
+
Use the following steps to prepare your project.
121
+
122
+
1. In your project's *pom.xml* file, add the following dependency:
1. In the *application.properties* file, remove any `spring.datasource.*` properties.
136
+
137
+
1. Update the current app by running `az spring app deploy`, or create a new deployment for this change by running `az spring app deployment create`.
138
+
139
+
## Bind your app to the Azure Database for PostgreSQL instance
140
+
141
+
### [Passwordless](#tab/PasswordlessSingle)
75
142
76
143
1. Install the [Service Connector](../service-connector/overview.md) passwordless extension for the Azure CLI:
77
144
@@ -93,7 +160,7 @@ Use the following steps to prepare your project.
93
160
--system-identity
94
161
```
95
162
96
-
### [Service Connector with password](#tab/Secrets)
163
+
### [Password](#tab/SecretsSingle)
97
164
98
165
Use the following steps to bind your app using a secret.
99
166
@@ -117,6 +184,8 @@ Use the following steps to bind your app using a secret.
117
184
118
185
---
119
186
187
+
::: zone-end
188
+
120
189
## Next steps
121
190
122
191
In this article, you learned how to bind an application in Azure Spring Apps to an Azure Database for PostgreSQL instance. To learn more about binding services to an application, see [Bind an Azure Cosmos DB database to an application in Azure Spring Apps](./how-to-bind-cosmos.md).
0 commit comments