-
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
application_gateway bug on request_routing_rule causes recreations #15841
Comments
@myc2h6o Thanks for this, your explanation makes perfect sense! I must admit though, i am not convinced this is a great idea for any production service, taking down a production service for a second while it re-adds all the rules, is certainly not a great option. Would it be possible to have seperate modules for adding the rules etc against an application gateway Id in the future to try and get around this? |
Im in the same situation. Will the rules actually get deleted and then re-added and cause downtime for all rules/listeners? |
Same here we will start using Appp Gateway for multi app hosting, but based on my testing when I add additional request_routing_rules all of the existing ones get recreated causing a little downtime on all the apps, please fix !!! |
I've done a small test with the application gateway routing requests to a raw nginx server on an ubuntu vm. When adding/modifying the request_routing_rules, there is no downtime during my test. By looking at the code, although the Terraform diff shows the removing/adding for the TypeSet, the provider doesn't remove all the routing rules, it just sends the PUT request to the service with the updated routing rules (in below code snippets). I've also tried modifying the rules on Azure Portal and the API request is same as it in the provider. terraform-provider-azurerm/internal/services/network/application_gateway_resource.go Lines 1849 to 1855 in cc228a0
terraform-provider-azurerm/internal/services/network/application_gateway_resource.go Lines 2049 to 2052 in cc228a0
However, when terraform-provider-azurerm/internal/services/network/application_gateway_resource.go Lines 3062 to 3064 in cc228a0
@wenesak in your test did you update the |
I've just experienced what I think is a related issue. After upgrading from v2 to v3 of the azurerm provider, I got change plans that look as if they wanted to recreate my
My configuration file did not specify the
This is with a |
I'm also experiencing this today with azurerm version 3.89.0. |
I am also experiencing the same issue with azurerm version 3.89.0. It is trying to recreate the routing rules in app gateway |
Any one have solution for this ? |
Currently the "azurerm_application_gateway" takes "request_routing_rule" which can have an optional field of priority. The problem with the priority field is that Azure defaults the value to 0 and the only values terraform allows are null or 1-2000. This seems fine until you want to add/remove any additional rules as Terraform now thinks all the rules are changing from 0 to NULL and makes you recreate them all again, rather than just the changes being added/removed.
I suspect this can easily be fixed by changing the validation logic to accept 0 on the priority field and defaulting NULL to 0 to match Azures logic.
The text was updated successfully, but these errors were encountered: