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

r/app_service: fixing a crash when provisioning an app service inside an ASE which doesn't exist yet #8993

Merged
merged 1 commit into from
Oct 27, 2020
Merged
Changes from all 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
5 changes: 4 additions & 1 deletion azurerm/internal/services/web/resource_arm_app_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ func resourceArmAppServiceCreate(d *schema.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, _ := aspClient.Get(ctx, aspID.ResourceGroup, aspID.Name)
aspDetails, err := aspClient.Get(ctx, aspID.ResourceGroup, aspID.Name)
if err != nil {
return fmt.Errorf("App Service Environment %q (Resource Group %q) does not exist", aspID.Name, aspID.ResourceGroup)
}
if aspDetails.HostingEnvironmentProfile != nil {
availabilityRequest.Name = utils.String(fmt.Sprintf("%s.%s.appserviceenvironment.net", name, aspID.Name))
availabilityRequest.IsFqdn = utils.Bool(true)
Expand Down