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
> Microsoft Entra ID (formerly Azure Active Directory) authentication in Azure Cosmos DB for PostgreSQL is currently in preview.
18
-
> This preview version is provided without a service level agreement, and it's not recommended
19
-
> for production workloads. Certain features might not be supported or might have constrained
20
-
> capabilities.
21
-
>
22
-
> You can see a complete list of other new features in [preview features](product-updates.md#features-in-preview).
23
-
24
16
Azure Cosmos DB for PostgreSQL supports PostgreSQL authentication and integration with Microsoft Entra ID. Each Azure Cosmos DB for PostgreSQL cluster is created with native PostgreSQL authentication enabled and one built-in PostgreSQL role named `citus`. You can add more native PostgreSQL roles after cluster provisioning is completed.
25
17
26
18
You can also enable Microsoft Entra ID (formerly Azure Active Directory) authentication on a cluster in addition to the PostgreSQL authentication method or instead of it. You can configure authentication methods on each Azure Cosmos DB for PostgreSQL cluster independently. If you need to change authentication method, you can do it at any time after cluster provisioning is completed. Changing authentication methods doesn't require cluster restart.
@@ -62,8 +54,9 @@ Notably, the `citus` role has some restrictions:
62
54
`citus` role can't be deleted but would be disabled if 'Microsoft Entra ID authentication only' authentication method is selected on cluster.
[Microsoft Entra ID](/entra/fundamentals/whatis) (formerly Azure Active Directory) authentication is a mechanism of connecting to Azure Cosmos DB for PostgreSQL using identities defined in Microsoft Entra ID. With Microsoft Entra ID authentication, you can manage database user identities and other Microsoft services in a central location, which simplifies permission management.
69
62
@@ -79,9 +72,9 @@ Benefits of using Microsoft Entra ID include:
79
72
80
73
### Manage PostgreSQL access for Microsoft Entra ID principals
81
74
82
-
When Microsoft Entra ID authentication is enabled and Microsoft Entra ID principal is added as a Microsoft Entra ID administrator, the account gets the same privileges as [the `citus` role](#the-citus-role). The Microsoft Entra ID administrator sign-in can be a Microsoft Entra ID user, Service Principal or Managed Identity. Multiple Microsoft Entra ID administrators can be configured at any time and you can optionally disable PostgreSQL (password) authentication to the Azure Cosmos DB for PostgreSQL cluster for better auditing and compliance needs.
75
+
When Microsoft Entra ID authentication is enabled and Microsoft Entra ID principal is added as a Microsoft Entra ID administrator, the account gets the same privileges as [the `citus` role](#the-citus-role). The Microsoft Entra ID administrator sign-in can be a Microsoft Entra ID user, Service Principal, or Managed Identity. Multiple Microsoft Entra ID administrators can be configured at any time and you can optionally disable PostgreSQL (password) authentication to the Azure Cosmos DB for PostgreSQL cluster for better auditing and compliance needs.
83
76
84
-
Additionally, any number of non-admin Microsoft Entra ID roles can be added to a cluster at any time once Microsoft Entra ID authentication is enabled. Database permissions for non-admin Microsoft Entra ID roles are managed similar to regular roles.
77
+
Additionally, any number of nonadmin Microsoft Entra ID roles can be added to a cluster at any time once Microsoft Entra ID authentication is enabled. Database permissions for nonadmin Microsoft Entra ID roles are managed similar to regular roles.
85
78
86
79
<aname='connect-using-azure-ad-identities'></a>
87
80
@@ -109,7 +102,7 @@ Once you've authenticated against the Microsoft Entra ID, you then retrieve a to
109
102
110
103
## Next steps
111
104
112
-
- Check out [Microsoft Entra ID limits and limitations in Azure Cosmos DB for PostgreSQL](./reference-limits.md#azure-active-directory-authentication)
105
+
- Check out [Microsoft Entra ID limits and limitations in Azure Cosmos DB for PostgreSQL](./reference-limits.md#microsoft-entra-id-authentication)
113
106
-[Learn how to configure authentication for Azure Cosmos DB for PostgreSQL clusters](./how-to-configure-authentication.md)
114
107
- Set up private network access to the cluster nodes, see [Manage private access](./howto-private-access.md)
115
108
- Set up public network access to the cluster nodes, see [Manage public access](./howto-manage-firewall-using-portal.md)
> Microsoft Entra ID (formerly Azure Active Directory) authentication in Azure Cosmos DB for PostgreSQL is currently in preview.
18
-
> This preview version is provided without a service level agreement, and it's not recommended
19
-
> for production workloads. Certain features might not be supported or might have constrained
20
-
> capabilities.
21
-
>
22
-
> You can see a complete list of other new features in [preview features](product-updates.md#features-in-preview).
23
-
24
16
In this article, you configure authentication methods for Azure Cosmos DB for PostgreSQL. You manage Microsoft Entra ID admin users and native PostgreSQL roles for authentication with Azure Cosmos DB for PostgreSQL. You also learn how to use a Microsoft Entra ID token with Azure Cosmos DB for PostgreSQL.
25
17
26
18
An Azure Cosmos DB for PostgreSQL cluster is created with one built-in native PostgreSQL role named 'citus'. You can add more native PostgreSQL roles after cluster provisioning is completed.
@@ -33,9 +25,9 @@ You need to use Azure portal to configure authentication methods on an Azure Cos
33
25
Complete the following items on your Azure Cosmos DB for PostgreSQL cluster to enable or disable Microsoft Entra ID authentication and native PostgreSQL authentication.
34
26
35
27
1. On the cluster page, under the **Cluster management** heading, choose **Authentication** to open authentication management options.
36
-
1. In **Authentication methods** section, choose **PostgreSQL authentication only**, **Microsoft Entra ID authentication (preview)**, or **PostgreSQL and Microsoft Entra ID authentication (preview)** as the authentication method based on your requirements.
28
+
1. In **Authentication methods** section, choose **PostgreSQL authentication only**, **Microsoft Entra ID authentication**, or **PostgreSQL and Microsoft Entra ID authentication** as the authentication method based on your requirements.
37
29
38
-
Once done proceed with [configuring Microsoft Entra ID authentication](#configure-azure-active-directory-authentication) or [adding native PostgreSQL roles](#configure-native-postgresql-authentication) on **Authentication** page.
30
+
Once done proceed with [configuring Microsoft Entra ID authentication](#configure-azure-active-directory-authentication) or [adding native PostgreSQL roles](#configure-native-postgresql-authentication) on the same **Authentication** page.
@@ -54,7 +46,7 @@ Users need to be allowed to sign in to Azure Cosmos DB for PostgreSQL in the Mic
54
46
1. Open 'Microsoft Entra ID' service.
55
47
1. On the **Overview** page of Microsoft Entra ID service in the **Overview** section, search for 'b4fa09d8-5da5-4352-83d9-05c2a44cf431' application ID.
56
48
1. Choose 'Azure Cosmos DB for PostgreSQL AAD Authentication' enterprise application in the search results.
57
-
1. In the Azure Cosmos DB for PostgreSQL AAD Authentication enterprise application, choose **Properties** page.
49
+
1. In the **Azure Cosmos DB for PostgreSQL AAD Authentication** enterprise application, choose **Properties** page.
58
50
1. Set **Enabled for users to sign-in?** to **Yes** and save the change.
59
51
60
52
# [Azure CLI](#tab/cli)
@@ -64,11 +56,14 @@ az ad sp update --id b4fa09d8-5da5-4352-83d9-05c2a44cf431 --set accountEnabled=t
64
56
```
65
57
---
66
58
59
+
> [!NOTE]
60
+
> Editing enterprise application's properties such as 'Enabled for users to sign-in' requires permissions granted to the Global Administrator, Cloud Application Administrator, or Application Administrator roles. See [the list of built-in Microsoft Entra roles](/entra/identity/role-based-access-control/permissions-reference).
61
+
67
62
### Add Microsoft Entra ID admins to Azure Cosmos DB for PostgreSQL cluster
68
63
69
64
To add or remove Microsoft Entra ID roles on cluster, follow these steps on **Authentication** page:
70
65
71
-
1. In **Microsoft Entra ID authentication (preview)** section, select **Add Microsoft Entra ID admins**.
66
+
1. In **Microsoft Entra ID authentication** section, select **Add Microsoft Entra ID admins**.
72
67
1. In **Select Microsoft Entra ID Admins** panel, select one or more valid Microsoft Entra ID user or enterprise application in the current AD tenant to be a Microsoft Entra ID administrator on your Azure Cosmos DB for PostgreSQL cluster.
73
68
1. Use **Select** to confirm your choice.
74
69
1. In the **Authentication** page, select **Save** in the toolbar to save changes or proceed with adding native PostgreSQL roles.
@@ -107,14 +102,16 @@ az login
107
102
108
103
The command opens a browser window to the Microsoft Entra ID authentication page. It requires you to give your Microsoft Entra ID user name and password.
109
104
105
+
The user account name you use to authenticate (for example, [email protected]) is the one the access token will be generated for in the next step.
106
+
110
107
<aname='retrieve-the-azure-ad-access-token'></a>
111
108
112
109
### Retrieve the Microsoft Entra ID access token
113
110
114
111
Use the Azure CLI to acquire an access token for the Microsoft Entra ID authenticated user to access Azure Cosmos for PostgreSQL. Here's an example:
115
112
116
113
```azurecli-interactive
117
-
az account get-access-token --resource https://postgres.cosmos.azure.com
114
+
az account get-access-token --resource https://token.postgres.cosmos.azure.com
118
115
```
119
116
120
117
After authentication is successful, Microsoft Entra ID returns an access token for current Azure subscription:
@@ -129,7 +126,7 @@ After authentication is successful, Microsoft Entra ID returns an access token f
129
126
}
130
127
```
131
128
132
-
The TOKEN is a Base64 string. It encodes all the information about the authenticated user and is targeted to the Azure Cosmos DB for PostgreSQL service. The token is valid for at least 5 minutes with the maximum of 90 minutes. The expiresOn defines actual token expiration time.
129
+
The TOKEN is a Base64 string. It encodes all the information about the authenticated user and is associated with the Azure Cosmos DB for PostgreSQL service. The token is valid for at least 5 minutes with the maximum of 90 minutes. The **expiresOn** defines actual token expiration time.
133
130
134
131
### Use a token as a password for signing in with client psql
> or clear the PGPASSWORD variable value to enter the password interactively.
168
165
> Authentication would fail with the wrong value in PGPASSWORD.
169
166
170
-
Now you can initiate a connection with Azure Cosmos DB for PostgreSQL as you usually would (without 'password' parameter in the command line):
167
+
Now you can initiate a connection with Azure Cosmos DB for PostgreSQL using the Microsoft Entra ID user account that the access token was generated for. You would do it as you usually would with the user account as the user and without 'password' parameter in the command line:
0 commit comments