-
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_application_gateway - support for rewriting urls with the url
block
#10950
azurerm_application_gateway - support for rewriting urls with the url
block
#10950
Conversation
a368c7c
to
fd38082
Compare
fd38082
to
878dad0
Compare
cff0322
to
1e6bec1
Compare
1e6bec1
to
83c7e7c
Compare
I have compiled and tested this locally and successfully deployed a url_rewrite against an app gateway. |
f51ae22
to
1246286
Compare
Hi @dhensby - Could you revert any changes to Thanks! |
1246286
to
30d8dc3
Compare
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 for the PR @dhensby - overall looks great, but i have some questions i've left inline to address before merge
azurerm/internal/services/network/application_gateway_resource.go
Outdated
Show resolved
Hide resolved
30d8dc3
to
89dfe38
Compare
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 @dhensby - LGTM 👍
url
block
This has been released in version 2.54.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.54.0"
}
# ... other configuration ... |
I think this is just how the front end in the portal is showing it. That option isn't actually part of the rest API, it's just how the portal shows the interface. |
@dhensby - after tests, the query strings are not working when it set to "Both URL path and URL query string" and not to "URL path" only. url { |
@ido-tr I don't really understand what you're saying. I've gone through to double check this all works as expected and I don't see any issues: Both path and query_string set: rewrite_rule_set {
name = "test-rewrite-ruleset"
rewrite_rule {
name = "test-rewrite-rule"
rule_sequence = 1
condition {
variable = "var_uri_path"
pattern = ".*article/(.*)/(.*)"
}
url {
path = "/article.aspx"
query_string = "id={var_uri_path_1}&title={var_uri_path_2}"
}
}
} In the portal: Just query_string: rewrite_rule_set {
name = "test-rewrite-ruleset"
rewrite_rule {
name = "test-rewrite-rule"
rule_sequence = 1
condition {
variable = "var_uri_path"
pattern = ".*article/(.*)/(.*)"
}
url {
query_string = "id={var_uri_path_1}&title={var_uri_path_2}"
}
}
} In the portal: Just path: rewrite_rule_set {
name = "test-rewrite-ruleset"
rewrite_rule {
name = "test-rewrite-rule"
rule_sequence = 1
condition {
variable = "var_uri_path"
pattern = ".*article/(.*)/(.*)"
}
url {
path = "/article.aspx"
}
}
} In the portal: All those are working as expected; can you provide me an example that doesn't work? |
Having inspected the state file, I think I see the problem. When no value is provided the state file shows that there is a value of I'm not entirely sure why this is the case, but I'll do some investigation as to why empty strings are going through when no value is provided. |
OK - this is where my lack of Go/terraform knowledge is letting me down - I can't see why empty values are being passed when values are missing. It appears it may not be possible to distinguish a missing value vs empty string for @katbyte any thoughts on this? |
@dhensby - this is exactly my point |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Fixes #7565
This is my first pass at trying to get
URLConfiguration
support into terraform (see https://docs.microsoft.com/en-us/rest/api/application-gateway/applicationgateways/get#applicationgatewayurlconfiguration).This will allow the rewriting of URLs in application gateway.
To-dos:
url_configuration.url_path
orurl_configuration.url_query
is supplied?example usage:
Test data based on example here https://docs.microsoft.com/en-us/azure/application-gateway/rewrite-url-portal