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_windows_web_app - fix health_check_eviction_time_in_min not being set issue #17656

Closed
wants to merge 10 commits into from

Conversation

xiaxyi
Copy link
Contributor

@xiaxyi xiaxyi commented Jul 18, 2022

This pr is fixing two issues:

  1. The property WEBSITE_HEALTHCHECK_MAXPINGFAILURES in app_setting is suppose to be set if user assign a value to the property health_check_eviction_time_in_min.
  2. The WEBSITE_HEALTHCHECK_MAXPINGFAILURES should be written back to the state file if user explicitly specify it in config.

fix issues:#17123
#17546
#16302

Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @xiaxyi - Thanks for this PR. I've left a couple comments below for changes I believe to be needed. But otherwise I think it looks good 👍

Thanks!

Comment on lines 3806 to 3811
if userInputAppSetting := d.ResourceData.Get("app_settings").(map[string]interface{}); userInputAppSetting != nil {
if _, ok := userInputAppSetting[maxPingFailures]; ok {
unmanagedSettings = unmanagedSettings[:len(unmanagedSettings)-1]
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed, users should set this value via health_check_eviction_time_in_min and not in the app_settings map. Leaving this in will lead to diffs in that map value. The second returned value from this function should be carried to be set in the site_config.0.health_check_eviction_time_in_min property.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But azure provided such way to set this property and lots of users are aware of this usage as well. shall we just let them set it via app_setting?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have moved it out of the map into its own property, therefor it should only be set there as @jackofallops, and if the user does put it into the app settings map we should maybe toss up an error telling the user to set it there?

Comment on lines 3788 to 3789
func FlattenAppSettings(input web.StringDictionary, d sdk.ResourceMetaData) (map[string]string, *int) {
maxPingFailures := "WEBSITE_HEALTHCHECK_MAXPINGFAILURES"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the metadata is not needed here, just the correction of the typo in the WEBSITE_HEALTHCHECK_MAXPINGFAILURES string.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to move the WEBSITE_HEALTHCHECK_MAXPINGFAILURES from the unmanagedSettings list if user adds the key explicitly in the config?

@xiaxyi
Copy link
Contributor Author

xiaxyi commented Aug 9, 2022

Thank @jackofallops for the comments, left some feedbacks inline

@katbyte
Copy link
Collaborator

katbyte commented Aug 9, 2022

also we have some test failureS:
image

@xiaxyi xiaxyi changed the title Fix health_check_eviction_time_in_min not being set issue azurerm_windows_web_app: Fix health_check_eviction_time_in_min not being set issue Aug 21, 2022
@xiaxyi
Copy link
Contributor Author

xiaxyi commented Aug 29, 2022

Thanks @jackofallops for the comments. I removed the app_setting KVP code change, also, the update check of app_setting should be removed as we are collecting data from site_config, which means, app_setting still needs to be updated even there is no change in the config.

For the test cases, I removed the property checks as we have the import step.

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we still have test failures
image

@xiaxyi
Copy link
Contributor Author

xiaxyi commented Sep 2, 2022

we still have test failures image

Thanks @katbyte for the comment, the acc test failure will be fixed in #18177

@xiaxyi xiaxyi changed the title azurerm_windows_web_app: Fix health_check_eviction_time_in_min not being set issue azurerm_windows_web_app - fix health_check_eviction_time_in_min not being set issue Nov 11, 2022
@github-actions github-actions bot added size/M and removed size/S labels Nov 11, 2022
@pierluca
Copy link

pierluca commented Dec 9, 2022

Thanks for addressing these issues.
Is there any ETA on when this issue will be fixed/merged/released ?

@jackofallops jackofallops mentioned this pull request Dec 14, 2022
1 task
@jackofallops
Copy link
Member

Closing as superseded by 19685

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants