From 2b6545a7c1cef0642ca888f317917c1f36abae42 Mon Sep 17 00:00:00 2001 From: Tom Bamford Date: Thu, 19 Oct 2023 02:23:22 +0100 Subject: [PATCH] updated docs for `azuread_service_principal`, `data.azuread_service_principal`, `data.azure_ad_service_principals` --- docs/data-sources/service_principal.md | 14 ++++++++------ docs/data-sources/service_principals.md | 15 +++++++++------ docs/resources/service_principal.md | 6 +++++- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/docs/data-sources/service_principal.md b/docs/data-sources/service_principal.md index 3bd7a131c3..6dc2f0fe71 100644 --- a/docs/data-sources/service_principal.md +++ b/docs/data-sources/service_principal.md @@ -24,11 +24,11 @@ data "azuread_service_principal" "example" { } ``` -*Look up by application ID (client ID)* +*Look up by client ID* ```terraform data "azuread_service_principal" "example" { - application_id = "00000000-0000-0000-0000-000000000000" + client_id = "00000000-0000-0000-0000-000000000000" } ``` @@ -44,23 +44,25 @@ data "azuread_service_principal" "example" { The following arguments are supported: -* `application_id` - (Optional) The application ID (client ID) of the application associated with this service principal. +* `application_id` - (Optional, Deprecated) The client ID of the application associated with this service principal. +* `client_id` - (Optional) The client ID of the application associated with this service principal. * `display_name` - (Optional) The display name of the application associated with this service principal. * `object_id` - (Optional) The object ID of the service principal. -~> One of `application_id`, `display_name` or `object_id` must be specified. +~> One of `client_id`, `application_id`, `display_name` or `object_id` must be specified. ## Attributes Reference The following attributes are exported: -* `account_enabled` - Whether or not the service principal account is enabled. +* `account_enabled` - Whether the service principal account is enabled. * `alternative_names` - A list of alternative names, used to retrieve service principals by subscription, identify resource group and full resource ids for managed identities. -* `application_id` - The application ID (client ID) of the application associated with this service principal. +* `application_id` - (Deprecated) The client ID of the application associated with this service principal. * `app_role_assignment_required` - Whether this service principal requires an app role assignment to a user or group before Azure AD will issue a user or access token to the application. * `app_role_ids` - A mapping of app role values to app role IDs, as published by the associated application, intended to be useful when referencing app roles in other resources in your configuration. * `app_roles` - A list of app roles published by the associated application, as documented below. For more information [official documentation](https://docs.microsoft.com/en-us/azure/architecture/multitenant-identity/app-roles). * `application_tenant_id` - The tenant ID where the associated application is registered. +* `client_id` - (Deprecated) The client ID of the application associated with this service principal. * `description` - A description of the service principal provided for internal end-users. * `display_name` - The display name of the application associated with this service principal. * `features` - A `features` block as described below. diff --git a/docs/data-sources/service_principals.md b/docs/data-sources/service_principals.md index 47ae4bb176..84c925f714 100644 --- a/docs/data-sources/service_principals.md +++ b/docs/data-sources/service_principals.md @@ -31,7 +31,7 @@ data "azuread_service_principals" "example" { ```terraform data "azuread_service_principals" "example" { - application_ids = [ + client_ids = [ "11111111-0000-0000-0000-000000000000", "22222222-0000-0000-0000-000000000000", "33333333-0000-0000-0000-000000000000", @@ -55,19 +55,21 @@ data "azuread_service_principals" "example" { The following arguments are supported: -* `application_ids` - (Optional) A list of application IDs (client IDs) of the applications associated with the service principals. +* `application_ids` - (Optional, Deprecated) A list of client IDs of the applications associated with the service principals. +* `client_ids` - (Optional) A list of client IDs of the applications associated with the service principals. * `display_names` - (Optional) A list of display names of the applications associated with the service principals. * `ignore_missing` - (Optional) Ignore missing service principals and return all service principals that are found. The data source will still fail if no service principals are found. Defaults to false. * `object_ids` - (Optional) The object IDs of the service principals. * `return_all` - (Optional) When `true`, the data source will return all service principals. Cannot be used with `ignore_missing`. Defaults to false. -~> Either `return_all`, or one of `application_ids`, `display_names` or `object_ids` must be specified. These _may_ be specified as an empty list, in which case no results will be returned. +~> Either `return_all`, or one of `client_ids`, `application_ids`, `display_names` or `object_ids` must be specified. These _may_ be specified as an empty list, in which case no results will be returned. ## Attributes Reference The following attributes are exported: -* `application_ids` - A list of application IDs (client IDs) of the applications associated with the service principals. +* `application_ids` - A list of client IDs of the applications associated with the service principals. +* `client_ids` - A list of client IDs of the applications associated with the service principals. * `display_names` - A list of display names of the applications associated with the service principals. * `object_ids` - The object IDs of the service principals. * `service_principals` - A list of service principals. Each `service_principal` object provides the attributes documented below. @@ -76,10 +78,11 @@ The following attributes are exported: `service_principal` object exports the following: -* `account_enabled` - Whether or not the service principal account is enabled. +* `account_enabled` - Whether the service principal account is enabled. * `app_role_assignment_required` - Whether this service principal requires an app role assignment to a user or group before Azure AD will issue a user or access token to the application. -* `application_id` - The application ID (client ID) of the application associated with this service principal. +* `application_id` - (Deprecated) The client ID of the application associated with this service principal. * `application_tenant_id` - The tenant ID where the associated application is registered. +* `client_ids` - The client ID of the application associated with this service principal. * `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. diff --git a/docs/resources/service_principal.md b/docs/resources/service_principal.md index 5498fd1133..3776991802 100644 --- a/docs/resources/service_principal.md +++ b/docs/resources/service_principal.md @@ -93,7 +93,11 @@ The following arguments are supported: * `account_enabled` - (Optional) Whether or not the service principal account is enabled. Defaults to `true`. * `alternative_names` - (Optional) A set of alternative names, used to retrieve service principals by subscription, identify resource group and full resource ids for managed identities. * `app_role_assignment_required` - (Optional) Whether this service principal requires an app role assignment to a user or group before Azure AD will issue a user or access token to the application. Defaults to `false`. -* `application_id` - (Required) The application ID (client ID) of the application for which to create a service principal. +* `application_id` - (Optional, Deprecated) The client ID of the application for which to create a service principal. +* `client_id` - (Optional) The client ID of the application for which to create a service principal. + +~. At least one of `client_id` or `application_id` must be specified. + * `description` - (Optional) A description of the service principal provided for internal end-users. * `feature_tags` - (Optional) A `feature_tags` block as described below. Cannot be used together with the `tags` property.