Retrieves the OData type for a generic directory object having the provided object ID.
The following API permissions are required in order to use this data source.
When authenticated with a service principal, this data source requires either User.Read.All
, Group.Read.All
or Directory.Read.All
, depending on the type of object being queried.
When authenticated with a user principal, this data source does not require any additional roles.
Look up and output type of object by ID
data "azuread_directory_object" "example" {
object_id = "00000000-0000-0000-0000-000000000000"
}
output "object_type" {
value = data.azuread_directory_object.example.type
}
The following arguments are supported:
object_id
- (Optional) Specifies the Object ID of the directory object to look up.The following attributes are exported:
*object_id
- The object ID of the directory object.
*type
- The shortened OData type of the directory object. Possible values include: Group
, User
or ServicePrincipal
.