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

Avoid panic if RG or ASE do not exist when creating an App Service #12518

Merged
merged 4 commits into from
Jul 8, 2021
Merged
Changes from 2 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
4 changes: 2 additions & 2 deletions azurerm/internal/services/web/app_service_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ func resourceAppServiceCreate(d *pluginsdk.ResourceData, meta interface{}) error
// Check if App Service Plan is part of ASE
// If so, the name needs updating to <app name>.<ASE name>.appserviceenvironment.net and FQDN setting true for name availability check
aspDetails, err := aspClient.Get(ctx, aspID.ResourceGroup, aspID.ServerfarmName)
if err != nil {
return fmt.Errorf("App Service Environment %q (Resource Group %q) does not exist", aspID.ServerfarmName, aspID.ResourceGroup)
if err != nil || utils.ResponseWasNotFound(aspDetails.Response) {
koikonom marked this conversation as resolved.
Show resolved Hide resolved
return fmt.Errorf("App Service Environment %q or Resource Group %q does not exist", aspID.ServerfarmName, aspID.ResourceGroup)
}
if aspDetails.HostingEnvironmentProfile != nil {
availabilityRequest.Name = utils.String(fmt.Sprintf("%s.%s.appserviceenvironment.net", name, *aspDetails.HostingEnvironmentProfile.Name))
Expand Down