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_application: updated resource ID #1255

Merged
merged 2 commits into from
Nov 16, 2023
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/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
Loading