Skip to content

Commit

Permalink
Merge pull request #1255 from hashicorp/f/application-data-source-upd…
Browse files Browse the repository at this point in the history
…ated-id

`data.azuread_application`: updated resource ID
  • Loading branch information
manicminer authored Nov 16, 2023
2 parents 7075cbd + 27dfb93 commit 053c058
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/data-sources/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ The following attributes are exported:
* `fallback_public_client_enabled` - The fallback application type as public client, such as an installed application running on a mobile device.
* `feature_tags` - A `features` block as described below.
* `group_membership_claims` - The `groups` claim issued in a user or OAuth 2.0 access token that the app expects.
* `id` - The Terraform resource ID for the application, for use when referencing this data source in your Terraform configuration.
* `identifier_uris` - A list of user-defined URI(s) that uniquely identify a Web application within it's Azure AD tenant, or within a verified custom domain if the application is multi-tenant.
* `logo_url` - CDN URL to the application's logo.
* `notes` - User-specified notes relevant for the management of the application.
Expand Down
4 changes: 3 additions & 1 deletion internal/services/applications/application_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/hashicorp/go-azure-sdk/sdk/odata"
"github.com/hashicorp/terraform-provider-azuread/internal/clients"
"github.com/hashicorp/terraform-provider-azuread/internal/helpers"
"github.com/hashicorp/terraform-provider-azuread/internal/services/applications/parse"
"github.com/hashicorp/terraform-provider-azuread/internal/tf"
"github.com/hashicorp/terraform-provider-azuread/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azuread/internal/tf/validation"
Expand Down Expand Up @@ -578,7 +579,8 @@ func applicationDataSourceRead(ctx context.Context, d *pluginsdk.ResourceData, m
return tf.ErrorDiagF(fmt.Errorf("Object ID returned for application is nil"), "Bad API Response")
}

d.SetId(*app.ID())
id := parse.NewApplicationID(*app.ID())
d.SetId(id.ID())

tf.Set(d, "api", flattenApplicationApi(app.Api, true))
tf.Set(d, "app_roles", flattenApplicationAppRoles(app.AppRoles))
Expand Down

0 comments on commit 053c058

Please sign in to comment.