Skip to content

Commit

Permalink
set resource id right after resource has been created
Browse files Browse the repository at this point in the history
  • Loading branch information
lonegunmanb committed Jan 17, 2024
1 parent 9d5c65a commit 156f460
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions internal/services/appservice/linux_function_app_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,8 @@ func (r LinuxFunctionAppResource) Create() sdk.ResourceFunc {
return fmt.Errorf("waiting for creation of Linux %s: %+v", id, err)
}

metadata.SetID(id)

// (@jackofallops) - updating the policy for publishing credentials resets the `Use32BitWorkerProcess` property
if !functionApp.PublishingDeployBasicAuthEnabled {
sitePolicy := web.CsmPublishingCredentialsPoliciesEntity{
Expand Down Expand Up @@ -643,8 +645,6 @@ func (r LinuxFunctionAppResource) Create() sdk.ResourceFunc {
return err
}
}

metadata.SetID(id)
return nil
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@ func (r LinuxFunctionAppSlotResource) Create() sdk.ResourceFunc {
return fmt.Errorf("waiting for creation of Linux %s: %+v", id, err)
}

metadata.SetID(id)

if !functionAppSlot.PublishingDeployBasicAuthEnabled {
sitePolicy := web.CsmPublishingCredentialsPoliciesEntity{
CsmPublishingCredentialsPoliciesEntityProperties: &web.CsmPublishingCredentialsPoliciesEntityProperties{
Expand Down Expand Up @@ -628,8 +630,6 @@ func (r LinuxFunctionAppSlotResource) Create() sdk.ResourceFunc {
return fmt.Errorf("updating App Service Log Settings for %s: %+v", id, err)
}
}

metadata.SetID(id)
return nil
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,8 @@ func (r WindowsFunctionAppResource) Create() sdk.ResourceFunc {
return fmt.Errorf("waiting for creation of Windows %s: %+v", id, err)
}

metadata.SetID(id)

if !functionApp.PublishingDeployBasicAuthEnabled {
sitePolicy := web.CsmPublishingCredentialsPoliciesEntity{
CsmPublishingCredentialsPoliciesEntityProperties: &web.CsmPublishingCredentialsPoliciesEntityProperties{
Expand Down Expand Up @@ -642,7 +644,6 @@ func (r WindowsFunctionAppResource) Create() sdk.ResourceFunc {
}
}

metadata.SetID(id)
return nil
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,8 @@ func (r WindowsFunctionAppSlotResource) Create() sdk.ResourceFunc {
return fmt.Errorf("waiting for creation of Windows %s: %+v", id, err)
}

metadata.SetID(id)

if !functionAppSlot.PublishingDeployBasicAuthEnabled {
sitePolicy := web.CsmPublishingCredentialsPoliciesEntity{
CsmPublishingCredentialsPoliciesEntityProperties: &web.CsmPublishingCredentialsPoliciesEntityProperties{
Expand Down Expand Up @@ -648,7 +650,6 @@ func (r WindowsFunctionAppSlotResource) Create() sdk.ResourceFunc {
}
}

metadata.SetID(id)
return nil
},
}
Expand Down

0 comments on commit 156f460

Please sign in to comment.