az afd rule
Manage delivery rules within the specified rule set.
Commands
Name | Description | Type | Status |
---|---|---|---|
az afd rule action | Core | GA | |
az afd rule action add |
Update a new delivery rule within the specified rule set. |
Core | GA |
az afd rule action list |
Get an existing delivery rule within a rule set. |
Core | GA |
az afd rule action remove |
Update a new delivery rule within the specified rule set. |
Core | GA |
az afd rule condition | Core | GA | |
az afd rule condition add |
Update a new delivery rule within the specified rule set. |
Core | GA |
az afd rule condition list |
Get an existing delivery rule within a rule set. |
Core | GA |
az afd rule condition remove |
Update a new delivery rule within the specified rule set. |
Core | GA |
az afd rule create |
Create a new delivery rule within the specified rule set. |
Core | GA |
az afd rule delete |
Delete an existing delivery rule within a rule set. |
Core | GA |
az afd rule list |
List all of the existing delivery rules within a rule set. |
Core | GA |
az afd rule show |
Get an existing delivery rule within a rule set. |
Core | GA |
az afd rule update |
Update a new delivery rule within the specified rule set. |
Core | GA |
az afd rule wait |
Place the CLI in a waiting state until a condition is met. |
Core | GA |
az afd rule create
Create a new delivery rule within the specified rule set.
az afd rule create --name --rule-name
--profile-name
--resource-group
--rule-set-name
[--action-name]
[--cache-behavior]
[--cache-duration]
[--custom-fragment]
[--custom-hostname]
[--custom-path]
[--custom-querystring]
[--destination]
[--enable-caching {0, 1, f, false, n, no, t, true, y, yes}]
[--enable-compression {0, 1, f, false, n, no, t, true, y, yes}]
[--forwarding-protocol]
[--header-action]
[--header-name]
[--header-value]
[--match-processing-behavior {Continue, Stop}]
[--match-values]
[--match-variable]
[--negate-condition {0, 1, f, false, n, no, t, true, y, yes}]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--operator]
[--order]
[--origin-group]
[--preserve-unmatched-path {0, 1, f, false, n, no, t, true, y, yes}]
[--query-parameters]
[--query-string-caching-behavior]
[--redirect-protocol]
[--redirect-type]
[--selector]
[--source-pattern]
[--transforms]
Examples
Create a rule to append a response header for requests from Thailand.
az afd rule create -g group --rule-set-name ruleset1 --profile-name profile --order 2 --match-variable RemoteAddress --operator GeoMatch --match-values TH --rule-name disablecaching --action-name ModifyResponseHeader --header-action Append --header-name X-CDN --header-value AFDX
Create a rule for http to https redirect
az afd rule create -g group --rule-set-name ruleset1 --profile-name profile --order 1 --rule-name "redirect" --match-variable RequestScheme --operator Equal --match-values HTTP --action-name "UrlRedirect" --redirect-protocol Https --redirect-type Moved
Required Parameters
Name of the delivery rule which is unique within the endpoint.
Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the rule set under the profile.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
The name of the action for the delivery rule: https://learn.microsoft.com/en-us/azure/frontdoor/front-door-rules-engine-actions.
Caching behavior for the requests.
The duration for which the content needs to be cached. Allowed format is hh:mm:ss.xxxxxx.
Fragment to add to the redirect URL.
Host to redirect. Leave empty to use the incoming host as the destination host.
The full path to redirect. Path cannot be empty and must start with /.Leave empty to use the incoming path as destination pat.
The set of query strings to be placed in the redirect URL.leave empty to preserve the incoming query string.
The destination path to be used in the rewrite.
Indicates whether to enable caching on the route.
Property | Value |
---|---|
Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
Indicates whether content compression is enabled on AzureFrontDoor. Default value is false.If compression is enabled, content will be served as compressed if user requests for a compressed version.Content won't be compressed on AzureFrontDoorwhen requested content is smaller than 8 MB or larger than 1 KB.
Property | Value |
---|---|
Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
Protocol this rule will use when forwarding traffic to backends.
Header action for the requests.
Name of the header to modify.
Value of the header.
If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
Default value: | Continue |
Accepted values: | Continue, Stop |
Match values of the match condition. e.g, space separated values 'GET' 'HTTP'. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Name of the match condition: https://learn.microsoft.com/en-us/azure/frontdoor/rules-match-conditions.
If true, negates the condition.
Property | Value |
---|---|
Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
Do not wait for the long-running operation to finish.
Property | Value |
---|---|
Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
Operator of the match condition.
The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not require any condition and actions listed in it will always be applied.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
Name or ID of the OriginGroup that would override the default OriginGroup.
If True, the remaining path after the source pattern will be appended to the new destination path.
Property | Value |
---|---|
Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
Query parameters to include or exclude. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Defines how CDN caches requests that include query strings.You can ignore any query strings when caching,bypass caching to prevent requests that contain query strings from being cached,or cache every request with a unique URL.
Protocol to use for the redirect.
The redirect type the rule will use when redirecting traffic.
Selector of the match condition.
A request URI pattern that identifies the type of requests that may be rewritten.
Transform to apply before matching. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az afd rule delete
Delete an existing delivery rule within a rule set.
az afd rule delete [--ids]
[--name --rule-name]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--profile-name]
[--resource-group]
[--rule-set-name]
[--subscription]
[--yes]
Examples
Remove a rule with name rule1.
az afd rule delete -g group --rule-set-name ruleSetName --profile-name profile --rule-name rule1
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of the delivery rule which is unique within the endpoint.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Do not wait for the long-running operation to finish.
Property | Value |
---|---|
Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of the rule set under the profile.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Do not prompt for confirmation.
Property | Value |
---|---|
Default value: | False |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az afd rule list
List all of the existing delivery rules within a rule set.
az afd rule list --profile-name
--resource-group
--rule-set-name
[--max-items]
[--next-token]
Examples
List all the routes within the specified endpoint.
az afd route list -g group --profile-name profile --endpoint-name endpoint1
Required Parameters
Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the rule set under the profile.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Total number of items to return in the command's output. If the total number of items available is more than the value specified, a token is provided in the command's output. To resume pagination, provide the token value in --next-token
argument of a subsequent command.
Property | Value |
---|---|
Parameter group: | Pagination Arguments |
Token to specify where to start paginating. This is the token value from a previously truncated response.
Property | Value |
---|---|
Parameter group: | Pagination Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az afd rule show
Get an existing delivery rule within a rule set.
az afd rule show [--ids]
[--name --rule-name]
[--profile-name]
[--resource-group]
[--rule-set-name]
[--subscription]
Examples
show details of the delivery rule with name rule1.
az afd rule show -g group --rule-set-name ruleSetName --profile-name profile --rule-name rule1
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of the delivery rule which is unique within the endpoint.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of the rule set under the profile.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az afd rule update
Update a new delivery rule within the specified rule set.
az afd rule update [--actions]
[--add]
[--conditions]
[--force-string {0, 1, f, false, n, no, t, true, y, yes}]
[--ids]
[--match-processing-behavior {Continue, Stop}]
[--name --rule-name]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--order]
[--profile-name]
[--remove]
[--resource-group]
[--rule-set-name]
[--set]
[--subscription]
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
A list of actions that are executed when all the conditions of a rule are satisfied. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>
.
Property | Value |
---|---|
Parameter group: | Generic Update Arguments |
A list of conditions that must be matched for the actions to be executed Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
Property | Value |
---|---|
Parameter group: | Generic Update Arguments |
Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
Accepted values: | Continue, Stop |
Name of the delivery rule which is unique within the endpoint.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Do not wait for the long-running operation to finish.
Property | Value |
---|---|
Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not require any condition and actions listed in it will always be applied.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Remove a property or an element from a list. Example: --remove property.list <indexToRemove>
OR --remove propertyToRemove
.
Property | Value |
---|---|
Parameter group: | Generic Update Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of the rule set under the profile.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>
.
Property | Value |
---|---|
Parameter group: | Generic Update Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az afd rule wait
Place the CLI in a waiting state until a condition is met.
az afd rule wait [--created]
[--custom]
[--deleted]
[--exists]
[--ids]
[--interval]
[--name --rule-name]
[--profile-name]
[--resource-group]
[--rule-set-name]
[--subscription]
[--timeout]
[--updated]
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Wait until created with 'provisioningState' at 'Succeeded'.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | False |
Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Wait until deleted.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | False |
Wait until the resource exists.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | False |
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Polling interval in seconds.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | 30 |
Name of the delivery rule which is unique within the endpoint.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of the rule set under the profile.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Maximum wait in seconds.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | 3600 |
Wait until updated with provisioningState at 'Succeeded'.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | False |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |