Data Source: azuread_groups

Gets Object IDs or Display Names for multiple Azure Active Directory groups.

API Permissions

The following API permissions are required in order to use this data source.

When authenticated with a service principal, this data source requires one of the following application roles: Group.Read.All or Directory.Read.All

When authenticated with a user principal, this data source does not require any additional roles.

Example Usage

Look up by group name

data "azuread_groups" "example" {
  display_names = ["group-a", "group-b"]
}

Look up by display name prefix

data "azuread_groups" "sales" {
  display_name_prefix = "sales-"
}

Look up all groups

data "azuread_groups" "all" {
  return_all = true
}

Look up all mail-enabled groups

data "azuread_groups" "mail_enabled" {
  mail_enabled = true
  return_all   = true
}

Look up all security-enabled groups that are not mail-enabled

data "azuread_groups" "security_only" {
  mail_enabled     = false
  return_all       = true
  security_enabled = true
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported: