-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Conversation
There was a problem hiding this 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!
if userInputAppSetting := d.ResourceData.Get("app_settings").(map[string]interface{}); userInputAppSetting != nil { | ||
if _, ok := userInputAppSetting[maxPingFailures]; ok { | ||
unmanagedSettings = unmanagedSettings[:len(unmanagedSettings)-1] | ||
} | ||
} | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
func FlattenAppSettings(input web.StringDictionary, d sdk.ResourceMetaData) (map[string]string, *int) { | ||
maxPingFailures := "WEBSITE_HEALTHCHECK_MAXPINGFAILURES" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
Thank @jackofallops for the comments, left some feedbacks inline |
health_check_eviction_time_in_min
not being set issueazurerm_windows_web_app
: Fix health_check_eviction_time_in_min
not being set issue
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
azurerm_windows_web_app
: Fix health_check_eviction_time_in_min
not being set issueazurerm_windows_web_app
- fix health_check_eviction_time_in_min
not being set issue
Thanks for addressing these issues. |
Closing as superseded by 19685 |
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. |
This pr is fixing two issues:
WEBSITE_HEALTHCHECK_MAXPINGFAILURES
in app_setting is suppose to be set if user assign a value to the propertyhealth_check_eviction_time_in_min
.WEBSITE_HEALTHCHECK_MAXPINGFAILURES
should be written back to the state file if user explicitly specify it in config.fix issues:#17123
#17546
#16302