Administrators Microsoft Entra - Create Or Update
Creates a new server administrator associated to a Microsoft Entra principal.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/administrators/{objectId}?api-version=2025-08-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
object
|
path | True |
string |
Object identifier of the Microsoft Entra principal. |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
|
server
|
path | True |
string minLength: 3maxLength: 63 pattern: ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)* |
The name of the server. |
|
subscription
|
path | True |
string (uuid) |
The ID of the target subscription. The value must be an UUID. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
| Name | Type | Description |
|---|---|---|
| properties.principalName |
string |
Name of the Microsoft Entra principal. |
| properties.principalType |
Type of Microsoft Entra principal to which the server administrator is associated. |
|
| properties.tenantId |
string |
Identifier of the tenant in which the Microsoft Entra principal exists. |
Responses
| Name | Type | Description |
|---|---|---|
| 202 Accepted |
Accepted. Headers
|
|
| Other Status Codes |
Error response describing why the operation failed. |
Security
azure_auth
Microsoft Entra OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name | Description |
|---|---|
| user_impersonation | impersonate your user account |
Examples
Add a server administrator associated to a Microsoft Entra principal.
Sample request
PUT https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/exampleresourcegroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/exampleserver/administrators/oooooooo-oooo-oooo-oooo-oooooooooooo?api-version=2025-08-01
{
"properties": {
"tenantId": "tttttttt-tttt-tttt-tttt-tttttttttttt",
"principalType": "User",
"principalName": "exampleuser@contoso.com"
}
}
Sample response
Azure-AsyncOperation: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/azureAsyncOperation/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa?api-version=2025-06-01-preview
Location: https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DBforPostgreSQL/locations/eastus/operationResults/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb?api-version=2025-06-01-preview
Definitions
| Name | Description |
|---|---|
|
Administrator |
Server administrator associated to a Microsoft Entra principal. |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
Principal |
Type of Microsoft Entra principal to which the server administrator is associated. |
AdministratorMicrosoftEntraAdd
Server administrator associated to a Microsoft Entra principal.
| Name | Type | Description |
|---|---|---|
| properties.principalName |
string |
Name of the Microsoft Entra principal. |
| properties.principalType |
Type of Microsoft Entra principal to which the server administrator is associated. |
|
| properties.tenantId |
string |
Identifier of the tenant in which the Microsoft Entra principal exists. |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
object |
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
PrincipalType
Type of Microsoft Entra principal to which the server administrator is associated.
| Value | Description |
|---|---|
| Unknown |
The principal type is not known or not specified. |
| User |
A Microsoft Entra user. |
| Group |
A Microsoft Entra group. |
| ServicePrincipal |
A Microsoft Entra service principal, typically representing an application or service identity |