owners
Creates, updates, deletes, gets or lists an owners resource.
Overview
| Name | owners |
| Type | Resource |
| Id | entra_id.service_principals.owners |
Fields
The following fields are returned by SELECT queries:
- list
Retrieved collection
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier for an entity. Read-only. |
deletedDateTime | string (date-time) | Date and time when this object was deleted. Always null when the object hasn't been deleted. (pattern: ^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | service_principal_id | ConsistencyLevel | Directory objects that are owners of this servicePrincipal. The owners are a set of nonadmin users or servicePrincipals who are allowed to modify this object. Supports $expand, $filter (/$count eq 0, /$count ne 0, /$count eq 1, /$count ne 1), and $select nested in $expand. |
add_ref | insert | service_principal_id | Use this API to add an owner for the servicePrincipal. Service principal owners can be users, the service principal itself, or other service principals. | |
remove_ref | delete | service_principal_id, directory_object_id | If-Match | Remove an owner from a servicePrincipal object. As a recommended best practice, service principals should have at least two owners. |
remove_ref_2 | delete | service_principal_id | If-Match | Remove an owner from a servicePrincipal object. As a recommended best practice, service principals should have at least two owners. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
directory_object_id | string | The unique identifier of directoryObject |
service_principal_id | string | The unique identifier of servicePrincipal |
ConsistencyLevel | string | Indicates the requested consistency level. Documentation URL: https://docs.microsoft.com/graph/aad-advanced-queries |
If-Match | string | ETag |
SELECT examples
- list
Directory objects that are owners of this servicePrincipal. The owners are a set of nonadmin users or servicePrincipals who are allowed to modify this object. Supports $expand, $filter (/$count eq 0, /$count ne 0, /$count eq 1, /$count ne 1), and $select nested in $expand.
SELECT
id,
deletedDateTime
FROM entra_id.service_principals.owners
WHERE service_principal_id = '{{ service_principal_id }}' -- required
AND ConsistencyLevel = '{{ ConsistencyLevel }}'
;
INSERT examples
- add_ref
- Manifest
Use this API to add an owner for the servicePrincipal. Service principal owners can be users, the service principal itself, or other service principals.
INSERT INTO entra_id.service_principals.owners (
directoryObjectId,
service_principal_id
)
SELECT
'{{ directoryObjectId }}',
'{{ service_principal_id }}'
;
# Description fields are for documentation purposes
- name: owners
props:
- name: service_principal_id
value: "{{ service_principal_id }}"
description: Required parameter for the owners resource.
- name: directoryObjectId
value: "{{ directoryObjectId }}"
description: |
The id of the directory object to reference (a user, group, service principal, device, ...). Sent on the wire as '@odata.id': 'https://graph.microsoft.com/v1.0/directoryObjects/{id}'.
DELETE examples
- remove_ref
- remove_ref_2
Remove an owner from a servicePrincipal object. As a recommended best practice, service principals should have at least two owners.
DELETE FROM entra_id.service_principals.owners
WHERE service_principal_id = '{{ service_principal_id }}' --required
AND directory_object_id = '{{ directory_object_id }}' --required
AND If-Match = '{{ If-Match }}'
;
Remove an owner from a servicePrincipal object. As a recommended best practice, service principals should have at least two owners.
DELETE FROM entra_id.service_principals.owners
AND service_principal_id = '{{ service_principal_id }}' --required
AND If-Match = '{{ If-Match }}'
;