Skip to content

Commit

Permalink
Merge pull request #749 from hashicorp/feature/sp-ds-objectid
Browse files Browse the repository at this point in the history
data.azuread_service_principals: export the `object_id` attribute in the `service_principals` list
  • Loading branch information
manicminer authored Mar 8, 2022
2 parents f988059 + 1ebaed6 commit 6d1ac22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/data-sources/service_principals.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ The following attributes are exported:
* `application_id` - The application ID (client ID) of the application associated with this service principal.
* `application_tenant_id` - The tenant ID where the associated application is registered.
* `display_name` - The display name of the application associated with this service principal.
* `object_id` - The object ID of the service principal.
* `preferred_single_sign_on_mode` - The single sign-on mode configured for this application. Azure AD uses the preferred single sign-on mode to launch the application from Microsoft 365 or the Azure AD My Apps.
* `saml_metadata_url` - The URL where the service exposes SAML metadata for federation.
* `service_principal_names` - A list of identifier URI(s), copied over from the associated application.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ func servicePrincipalsDataSource() *schema.Resource {
Computed: true,
},

"object_id": {
Description: "The object ID of the service principal",
Type: schema.TypeString,
Computed: true,
},

"preferred_single_sign_on_mode": {
Description: "The single sign-on mode configured for this application. Azure AD uses the preferred single sign-on mode to launch the application from Microsoft 365 or the Azure AD My Apps",
Type: schema.TypeString,
Expand Down Expand Up @@ -296,6 +302,7 @@ func servicePrincipalsDataSourceRead(ctx context.Context, d *schema.ResourceData
sp["app_role_assignment_required"] = s.AppRoleAssignmentRequired
sp["application_id"] = s.AppId
sp["application_tenant_id"] = s.AppOwnerOrganizationId
sp["object_id"] = s.ID
sp["preferred_single_sign_on_mode"] = s.PreferredSingleSignOnMode
sp["saml_metadata_url"] = s.SamlMetadataUrl
sp["service_principal_names"] = servicePrincipalNames
Expand Down

0 comments on commit 6d1ac22

Please sign in to comment.