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_application_gateway documentation doesn't reflect mandatory arguments #16793

Closed
1 task done
bubbletroubles opened this issue May 15, 2022 · 10 comments · Fixed by #16794 or #16849
Closed
1 task done

azurerm_application_gateway documentation doesn't reflect mandatory arguments #16793

bubbletroubles opened this issue May 15, 2022 · 10 comments · Fixed by #16794 or #16849

Comments

@bubbletroubles
Copy link
Contributor

bubbletroubles commented May 15, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.x

AzureRM Provider Version

3.6.0

Affected Resource(s)/Data Source(s)

azurerm_application_gateway

Terraform Configuration Files

n/a

Debug Output/Panic Output

n/a

Expected Behaviour

The documentation for azurerm_application_gateway states that the priority within the request_routing_rule block is optional.

It is now mandatory as of API 2021-08-01.

Actual Behaviour

When no priority is set, the error below happens

│ Error: creating Application Gateway: (Name "app-gw" / Resource Group "example"): network.ApplicationGatewaysClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="ApplicationGatewayRequestRoutingRulePriorityCannotBeEmpty" Message="Priority for the request routing rule /subscriptions/xxxxx/resourceGroups/app-gw/providers/Microsoft.Network/applicationGateways/app-gw/requestRoutingRules/routing-rule cannot be empty. All request routing rules should have a priority defined starting from api-version 2021-08-01" Details=[]

Steps to Reproduce

No response

Important Factoids

The Application Gateway API version was changed as below. This issue was introduced with the newer api version.

"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-05-01/network"  - AzureRM 3.5.0
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network"  - AzureRM 3.6.0

References

No response

@adamfd
Copy link

adamfd commented May 16, 2022

Same issue. Using a dynamic block of routing rules, applying fine in 3.5, but failing in 3.6 for the same error with the updated API version.
In 3.5, it seems all the rules have a priority, but looks to be assigned by Azure in the order they are created 10/20/30 etc. That does not seem to be the case in 3.6, where it must be specified.

@anishtechnet
Copy link

I am trying to run terraform script for Application gateway. There are no changes in my code and pipelines. I am getting these error messages:
ApplicationGatewayRequestRoutingRulePriorityCannotBeEmpty
All request routing rules should have a priority defined starting from api-version 2021-08-01

@bubbletroubles
Copy link
Contributor Author

I am trying to run terraform script for Application gateway. There are no changes in my code and pipelines. I am getting these error messages: ApplicationGatewayRequestRoutingRulePriorityCannotBeEmpty All request routing rules should have a priority defined starting from api-version 2021-08-01

You will need to pin to the provider to azurerm 3.5.0 or earlier. From 3.6.0 onwards the priority is needed.

@anishtechnet
Copy link

I added priority on request_routing_rule and resolved the issue. Thank you all.

@karishma-kohli
Copy link

karishma-kohli commented May 16, 2022

Facing the same issue since yesterday, if they keep rolling out breaking changes like this, it's going to be hard to manage the modules. I fixed 5 modules in my org recently to make them 3.x.x compatible.

I don't understand why the documentation is not updated when the change is rolled out. In the docs, the priority is still optional.

@SudhirG85
Copy link

I added priority on request_routing_rule and resolved the issue. Thank you all.

Could you please share the entry/value you provided for "priority" in request_routing_rule, because we too have one app gateway created by terraform for multiple domains.

@github-actions
Copy link

This functionality has been released in v3.7.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!

@Nicolas92300
Copy link

Nicolas92300 commented Jun 1, 2022

you need add priority in request_routing_rule, for exemple :

request_routing_rule {
name = var.rule_name
rule_type = "Basic"
http_listener_name = var.listener_name
backend_address_pool_name = var.bp_name
backend_http_settings_name = var.http_setting_name
priority = 10
}
request_routing_rule {
name = var.rule_name2
rule_type = "Basic"
http_listener_name = var.listener_name2
backend_address_pool_name = var.bp_name2
backend_http_settings_name = var.http_setting_name2
priority = 20
}

@bubbletroubles
Copy link
Contributor Author

I added priority on request_routing_rule and resolved the issue. Thank you all.

Could you please share the entry/value you provided for "priority" in request_routing_rule, because we too have one app gateway created by terraform for multiple domains.

I've submitted a pull request to include priority in the example code which should help clarify in future too -
#17079
#16849

@github-actions
Copy link

github-actions bot commented Jul 3, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, 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 Jul 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.