Skip to content

Commit

Permalink
azuread_application - support the description property
Browse files Browse the repository at this point in the history
  • Loading branch information
manicminer committed Jan 13, 2023
1 parent 397184d commit 817acf4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/services/applications/application_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,13 @@ func applicationResource() *schema.Resource {
},
},

"description": {
Description: "Description of the application as shown to end users",
Type: schema.TypeString,
Optional: true,
ValidateDiagFunc: validate.ValidateDiag(validation.StringLenBetween(0, 1024)),
},

"device_only_auth_enabled": {
Description: "Specifies whether this application supports device authentication without a user.",
Type: schema.TypeBool,
Expand Down Expand Up @@ -951,6 +958,7 @@ func applicationResourceCreate(ctx context.Context, d *schema.ResourceData, meta
properties := msgraph.Application{
Api: expandApplicationApi(d.Get("api").([]interface{})),
AppRoles: expandApplicationAppRoles(d.Get("app_role").(*schema.Set).List()),
Description: utils.NullableString(d.Get("description").(string)),
DisplayName: utils.String(tempDisplayName),
GroupMembershipClaims: expandApplicationGroupMembershipClaims(d.Get("group_membership_claims").(*schema.Set).List()),
IdentifierUris: tf.ExpandStringSlicePtr(d.Get("identifier_uris").(*schema.Set).List()),
Expand Down Expand Up @@ -1121,6 +1129,7 @@ func applicationResourceUpdate(ctx context.Context, d *schema.ResourceData, meta
},
Api: expandApplicationApi(d.Get("api").([]interface{})),
AppRoles: expandApplicationAppRoles(d.Get("app_role").(*schema.Set).List()),
Description: utils.NullableString(d.Get("description").(string)),
DisplayName: utils.String(displayName),
GroupMembershipClaims: expandApplicationGroupMembershipClaims(d.Get("group_membership_claims").(*schema.Set).List()),
IdentifierUris: tf.ExpandStringSlicePtr(d.Get("identifier_uris").(*schema.Set).List()),
Expand Down Expand Up @@ -1217,6 +1226,7 @@ func applicationResourceRead(ctx context.Context, d *schema.ResourceData, meta i
tf.Set(d, "app_role", flattenApplicationAppRoles(app.AppRoles))
tf.Set(d, "app_role_ids", flattenApplicationAppRoleIDs(app.AppRoles))
tf.Set(d, "application_id", app.AppId)
tf.Set(d, "description", app.Description)
tf.Set(d, "device_only_auth_enabled", app.IsDeviceOnlyAuthSupported)
tf.Set(d, "disabled_by_microsoft", fmt.Sprintf("%v", app.DisabledByMicrosoftStatus))
tf.Set(d, "display_name", app.DisplayName)
Expand Down
2 changes: 2 additions & 0 deletions internal/services/applications/application_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ resource "azuread_application" "test" {
fallback_public_client_enabled = true
oauth2_post_response_required = true
description = "Acceptance testing application"
marketing_url = "https://hashitown-%[1]d.com/"
privacy_statement_url = "https://hashitown-%[1]d.com/privacy"
support_url = "https://support.hashitown-%[1]d.com/"
Expand Down Expand Up @@ -850,6 +851,7 @@ resource "azuread_application" "test" {
fallback_public_client_enabled = true
oauth2_post_response_required = true
description = "Acceptance testing application"
marketing_url = "https://templatetown-%[1]d.com/"
privacy_statement_url = "https://templatetown-%[1]d.com/privacy"
support_url = "https://support.templatetown-%[1]d.com/"
Expand Down

0 comments on commit 817acf4

Please sign in to comment.