I need to associate my rewrite rule set with the routings rules in my Application Gateway in Azure using AZ CLI but I can’t with the commands I have used.
I tried some commands but any doesn’t work.
I need help. I just need to associate my rewrite rule set with the routings rules in my Application Gateway in Azure. And I must do this action with AZ CLI or with some other mechanism that can be automated.
I tried associate the rewrite rules set to my routing rules with these commands:
az network application-gateway rewrite-rule set update `
--gateway-name <application_gateway> `
--resource-group <resource_group> `
--name <rewrite_rule_set> `
--rule-name <routing_rule>
–> ERROR: ‘–rule-name’ is misspelled or not recognized by the system.
az network application-gateway rewrite-rule set create `
--resource-group <resource_group> `
--gateway-name <application_gateway> `
--name <rewrite rule> `
--rule-set-type RequestResponse `
--rule-set-version 1.0 `
--rule-sequence 100 `
--action RewriteValue `
--value <value> `
--sequence <sequence> `
--routing-rule-name <routing_rule>
–> But I do not need to create a rewrite rule set. I just need to associate a existing rewrite rule set to my routing rules.
I just need to associate my rewrite rule set to my routing rules in my Application Gateway in Azure. And I must do this action with AZ CLI or with some other mechanism that can be automated.
Please I need some help.
2
Answers
I agree with @Thomas, you can make use of below CLI command to associate existing rewrite rule set with the routing rule:
I have one application gateway named
appgw1
with below rules:I created one rewrite rule set named
srirewrite
without associating it with any rules like this:To associate existing rewrite rule set with rules, I ran below CLI command:
Response:
When I checked the same in Portal,
rule1
associated with existing rewrite rule set successfully like below:how to disassociate a rule from rewriteset ?