Skip to content

Commit

Permalink
use helper to get and set site_credential
Browse files Browse the repository at this point in the history
  • Loading branch information
stephybun committed Nov 6, 2024
1 parent a84ac23 commit 8b6550b
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions internal/services/logic/logic_app_standard_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/tags"
"github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-12-01/webapps"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/logic/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/timeouts"
Expand Down Expand Up @@ -327,20 +328,13 @@ func dataSourceLogicAppStandardRead(d *pluginsdk.ResourceData, meta interface{})
}
}

siteCredFuture, err := client.ListPublishingCredentials(ctx, id)
siteCredentials, err := helpers.ListPublishingCredentials(ctx, client, id)
if err != nil {
return fmt.Errorf("listing publishing credentials for %s: %+v", id, err)
}

if err = siteCredFuture.Poller.PollUntilDone(ctx); err != nil {
return fmt.Errorf("waiting to list the publishing credentials for %s: %+v", id, err)
}

if model := siteCredFuture.Model; model != nil {
siteCred := flattenLogicAppStandardDataSourceSiteCredential(model.Properties)
if err = d.Set("site_credential", siteCred); err != nil {
return err
}
if err = d.Set("site_credential", flattenLogicAppStandardSiteCredential(siteCredentials)); err != nil {
return err
}

return nil
Expand Down

0 comments on commit 8b6550b

Please sign in to comment.