-
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
Fix currentStack is being reset when other site_config values are changed. #18568
Conversation
Mentioned the same problem when applying azurerm_windows_web_app |
Hi, when can we get this PR merged? |
@katbyte Can you please check this PR? |
@jackofallops Can please help to review and merge? |
Yes, please try get this released. It's affecting us too, where we have to double apply each time |
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.
Thanks @KangDroid
This LGTM 👍
…nged. (hashicorp#18568) Co-authored-by: KangDroid <kangdroid@outlook.com>
This functionality has been released in v3.34.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I just ran 3.34 on our appservice and after applying once, and then rerunning a plan I still get a change showing it wants to turn dotnet 4.0 to dotnetcore core3.1 - https://app.screencast.com/SDKV950PZXVzQ?conversation=N0roBpGiXhD85fw3hJpBxG Can anyone see what I'm missing? |
I see the issue is with:- 2022-12-15 12:13:28 + application_stack { application_stack is not getting applied for azurerm-windows-web-app but it is applied for azurerm-linux-web-app |
You can ignore it seems to work for me now. 2022-12-15 13:15:52 ~ site_config { Used -- Tested |
…nged. (hashicorp#18568) Co-authored-by: KangDroid <kangdroid@outlook.com>
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. |
Background(Problem)
Few months ago, I've submitted PR that fixes current_stack is always being reset every time we update azure app service(windows) infrastructure.
After time passes, I've identified that whenever site_config's value changes - is resets site_config again.
Again, it turns out I had to double-apply all the time whenever I apply updates to Azure infrastructure.
Investigation & Possible Cause
With little golang knowledge and Terraform Azure RM Provider's architecture style, I've found that currentStack variable in
internal/services/appservice/helpers/web_app_schema.go : func ExpandSiteConfigWindows
is always being reset when site_config expansion starts. - But ifmetadata.ResourceData.HasChange("site_config.0.application_stack")
is false, meaning user did not really intended to modify application_stack - it never expands application_stack and set to empty value and sent empty value to app service.However, if user intended to change application_stack, it will update application_stack correctly.
Reproduce?
terraform plan
Solutions
Related Issues
Others
Please let me know if I am doing something wrong. Feedbacks, other suggestions are always welcome!
Thanks 👍