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

azurerm_linux_web_app, linux_web_app_slot - update API version to 2023-01-01 #24447

Closed
wants to merge 7 commits into from
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,9 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
if client.AppPlatform, err = appPlatform.NewClient(o); err != nil {
return fmt.Errorf("building clients for AppPlatform: %+v", err)
}
client.AppService = appService.NewClient(o)
if client.AppService, err = appService.NewClient(o); err != nil {
return fmt.Errorf("building clients for AppService: %+v", err)
}
if client.ArcKubernetes, err = arckubernetes.NewClient(o); err != nil {
return fmt.Errorf("building clients for ArcKubernetes: %+v", err)
}
Expand Down
24 changes: 22 additions & 2 deletions internal/services/appservice/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
package client

import (
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/resourceproviders"
"github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/webapps"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
"github.com/tombuildsstuff/kermit/sdk/web/2022-09-01/web"
)
Expand All @@ -13,9 +17,11 @@ type Client struct {
BaseClient *web.BaseClient
ServicePlanClient *web.AppServicePlansClient
WebAppsClient *web.AppsClient
LinuxWebAppsClient *webapps.WebAppsClient
AvailabilityClient *resourceproviders.ResourceProvidersClient
}

func NewClient(o *common.ClientOptions) *Client {
func NewClient(o *common.ClientOptions) (*Client, error) {
appServiceEnvironmentClient := web.NewAppServiceEnvironmentsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&appServiceEnvironmentClient.Client, o.ResourceManagerAuthorizer)

Expand All @@ -25,13 +31,27 @@ func NewClient(o *common.ClientOptions) *Client {
webAppServiceClient := web.NewAppsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&webAppServiceClient.Client, o.ResourceManagerAuthorizer)

linuxWebAppServiceClient, err := webapps.NewWebAppsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building WebApps client: %+v", err)
}
o.Configure(linuxWebAppServiceClient.Client, o.Authorizers.ResourceManager)

servicePlanClient := web.NewAppServicePlansClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&servicePlanClient.Client, o.ResourceManagerAuthorizer)

availabilityClient, err := resourceproviders.NewResourceProvidersClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building WebApps operation client: %+v", err)
}
o.Configure(availabilityClient.Client, o.Authorizers.ResourceManager)

return &Client{
AppServiceEnvironmentClient: &appServiceEnvironmentClient,
BaseClient: &baseClient,
ServicePlanClient: &servicePlanClient,
LinuxWebAppsClient: linuxWebAppServiceClient,
WebAppsClient: &webAppServiceClient,
}
AvailabilityClient: availabilityClient,
}, nil
}
Loading
Loading