Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data.azuread_service_principals: export the object_id attribute in the service_principals list #749

Merged
merged 1 commit into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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