Configure system or user assigned managed identities in Azure Database for PostgreSQL - Flexible Server
APPLIES TO: Azure Database for PostgreSQL - Flexible Server
In this article, you can learn how to enable or disable a system assigned managed identity for your instance of Azure Database for PostgreSQL flexible server. You can also learn how to add or remove one or more user assigned managed identities to your instance.
Enable the system assigned managed identity for existing servers
Using the Azure portal:
Locate your server in the portal, if you don't have it open. One way to do it is by typing the name of the server in the search bar. When the resource with the matching name is shown, select that resource.
In the resource menu, under Security, select Identity. Then, in the System assigned managed identity section, select the On option. Select Save.
When the process completes, a notification informs you that the system assigned managed identity is enabled.
Disable the system assigned managed identity for existing servers
Using the Azure portal:
Locate your server in the portal, if you don't have it open. One way to do it is by typing the name of the server in the search bar. When the resource with the matching name is shown, select that resource.
In the resource menu, under Security, select Identity. Then, in the System assigned managed identity section, select the Off option. Select Save.
When the process completes, a notification informs you that the system assigned managed identity is disabled.
Show the system assigned managed identity
Using the Azure portal:
Locate your server in the portal, if you don't have it open. One way to do it is by typing the name of the server in the search bar. When the resource with the matching name is shown, select that resource.
In the resource menu, under Overview, select JSON View.
In the Resource JSON panel that opens, find the identity property and, inside it, you can find the principalId and tenantId for the system assigned managed identity.
Verify the system assigned managed identity
Using the Azure portal:
Locate the Enterprise Applications service in the portal, if you don't have it open. One way to do it is by typing its name in the search bar. When the service with the matching name is shown, select it.
Choose Application Type == Managed Identity.
Provide the name of your instance of Azure Database for PostgreSQL flexible server in the Search by application name or object ID text box.
Associate user assigned managed identities to existing servers
This article assumes you created the user assigned managed identities that you want to associate to an existing instance of Azure Database for PostgreSQL flexible server.
For more information, see how to manage user assigned managed identities in Microsoft Entra ID.
You can associate as many user assigned managed identities as you want to an instance of Azure Database for PostgreSQL flexible server.
There's no support to associate user assigned managed identities to an instance of Azure Database for PostgreSQL flexible server via the portal.
Dissociate user assigned managed identities to existing servers
The service supports dissociating user assigned managed identities which are associated to an instance of Azure Database for PostgreSQL flexible server.
An exception to that rule is any of the user assigned managed identities that are designated as the ones that should be used to access the encryption keys. This case is only possible on servers that were deployed with data encryption using customer managed keys.
There's no support to dissociate user assigned managed identities from an instance of Azure Database for PostgreSQL flexible server via the portal.
Show the associated user assigned managed identities
Using the Azure portal:
Locate your server in the portal, if you don't have it open. One way to do it is by typing the name of the server in the search bar. When the resource with the matching name is shown, select that resource.
In the resource menu, under Overview, select JSON View.
In the Resource JSON panel that opens, find the identity property and, inside it, you can find the userAssignedIdentities. That object consists of one or more key/value pairs, where each key represents the resource identifier of one user assigned managed identity, and their corresponding value is made of principalId and clientId associated to that managed identity.
Share your suggestions and bugs with the Azure Database for PostgreSQL product team.
Related content
- Managed identities in Azure Database for PostgreSQL - Flexible Server.
- Firewall rules in Azure Database for PostgreSQL - Flexible Server.
- Public access and private endpoints in Azure Database for PostgreSQL - Flexible Server.
- Virtual network integration in Azure Database for PostgreSQL - Flexible Server.