Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
5 changes: 4 additions & 1 deletion internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,10 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
if client.VoiceServices, err = voiceServices.NewClient(o); err != nil {
return fmt.Errorf("building clients for Voice Services: %+v", err)
}
client.Web = web.NewClient(o)

if client.Web, err = web.NewClient(o); err != nil {
return fmt.Errorf("building clients for Web: %+v", err)
}

if client.Workloads, err = workloads.NewClient(o); err != nil {
return fmt.Errorf("building clients for Workloads: %+v", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ func (r AppServiceEnvironmentV3Resource) Delete() sdk.ResourceFunc {
}

func (r AppServiceEnvironmentV3Resource) IDValidationFunc() pluginsdk.SchemaValidateFunc {
return validate.AppServiceEnvironmentID
return commonids.ValidateAppServiceEnvironmentID
}

func (r AppServiceEnvironmentV3Resource) Update() sdk.ResourceFunc {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ import (
"testing"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/web/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/utils"
)

type AppServiceEnvironmentV3Resource struct{}
Expand Down Expand Up @@ -170,20 +169,17 @@ func TestAccAppServiceEnvironmentV3_dedicatedHosts(t *testing.T) {
}

func (AppServiceEnvironmentV3Resource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) {
id, err := parse.AppServiceEnvironmentID(state.ID)
id, err := commonids.ParseAppServiceEnvironmentID(state.ID)
if err != nil {
return nil, err
}

resp, err := client.Web.AppServiceEnvironmentsClient.Get(ctx, id.ResourceGroup, id.HostingEnvironmentName)
resp, err := client.AppService.AppServiceEnvironmentClient.Get(ctx, *id)
if err != nil {
if utils.ResponseWasNotFound(resp.Response) {
return pointer.To(false), nil
}
return nil, fmt.Errorf("retrieving App Service Environment V3 %q (Resource Group %q): %+v", id.HostingEnvironmentName, id.ResourceGroup, err)
return nil, fmt.Errorf("retrieving %s: %+v", id, err)
}

return pointer.To(true), nil
return pointer.To(resp.Model != nil), nil
}

func (r AppServiceEnvironmentV3Resource) basic(data acceptance.TestData) string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/migration"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate"
storageValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
Expand Down Expand Up @@ -808,7 +807,7 @@ func (r LinuxFunctionAppResource) Read() sdk.ResourceFunc {
state.ServicePlanId = servicePlanId.ID()

if hostingEnv := props.HostingEnvironmentProfile; hostingEnv != nil {
hostingEnvId, err := parse.AppServiceEnvironmentIDInsensitively(*hostingEnv.Id)
hostingEnvId, err := commonids.ParseAppServiceEnvironmentIDInsensitively(*hostingEnv.Id)
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions internal/services/appservice/linux_web_app_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/migration"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
Expand Down Expand Up @@ -651,7 +650,7 @@ func (r LinuxWebAppResource) Read() sdk.ResourceFunc {
state.ServicePlanId = servicePlanId.ID()

if hostingEnv := props.HostingEnvironmentProfile; hostingEnv != nil {
hostingEnvId, err := parse.AppServiceEnvironmentIDInsensitively(*hostingEnv.Id)
hostingEnvId, err := commonids.ParseAppServiceEnvironmentIDInsensitively(*hostingEnv.Id)
if err != nil {
return err
}
Expand Down
117 changes: 0 additions & 117 deletions internal/services/appservice/parse/app_service_environment.go

This file was deleted.

Loading
Loading