Share via


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
objectId
path True

string

Object identifier of the Microsoft Entra principal.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

serverName
path True

string

minLength: 3
maxLength: 63
pattern: ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*

The name of the server.

subscriptionId
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

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

  • Location: string
  • Azure-AsyncOperation: string
Other Status Codes

ErrorResponse

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
AdministratorMicrosoftEntraAdd

Server administrator associated to a Microsoft Entra principal.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

PrincipalType

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

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

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

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