Data Source: azuread_service_principal

Gets information about an existing service principal associated with an application within Azure Active Directory.

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: Application.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 application display name

data "azuread_service_principal" "example" {
  display_name = "my-awesome-application"
}

Look up by client ID

data "azuread_service_principal" "example" {
  client_id = "00000000-0000-0000-0000-000000000000"
}

Look up by service principal object ID

data "azuread_service_principal" "example" {
  object_id = "00000000-0000-0000-0000-000000000000"
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:


app_roles block exports the following:


features block exports the following:


oauth2_permission_scopes block exports the following:


saml_single_sign_on exports the following: