az afd route
Note
This reference is part of the cdn extension for the Azure CLI (version 2.85.0 or higher). The extension will automatically install the first time you run an az afd route command. Learn more about extensions.
Manage routes under an AFD endpoint.
Commands
| Name | Description | Type | Status |
|---|---|---|---|
| az afd route create |
Create a new route with the specified route name under the specified subscription, resource group, profile, and AzureFrontDoor endpoint. |
Extension | GA |
| az afd route delete |
Delete an existing route with the specified route name under the specified subscription, resource group, profile, and AzureFrontDoor endpoint. |
Extension | GA |
| az afd route list |
List all of the existing origins within a profile. |
Extension | GA |
| az afd route show |
Get an existing route with the specified route name under the specified subscription, resource group, profile, and AzureFrontDoor endpoint. |
Extension | GA |
| az afd route update |
Update a new route with the specified route name under the specified subscription, resource group, profile, and AzureFrontDoor endpoint. |
Extension | GA |
| az afd route wait |
Place the CLI in a waiting state until a condition is met. |
Extension | GA |
az afd route create
Create a new route with the specified route name under the specified subscription, resource group, profile, and AzureFrontDoor endpoint.
az afd route create --endpoint-name
--name --route-name
--profile-name
--resource-group
[--acquire-policy-token]
[--cache-configuration]
[--change-reference]
[--enabled-state {Disabled, Enabled}]
[--formatted-custom-domains]
[--formatted-rule-sets]
[--forwarding-protocol {HttpOnly, HttpsOnly, MatchRequest}]
[--https-redirect {Disabled, Enabled}]
[--link-to-default-domain {Disabled, Enabled}]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--origin-group]
[--origin-path]
[--patterns-to-match]
[--supported-protocols]
Examples
Routes_Create
az afd route create --resource-group RG --profile-name profile1 --endpoint-name endpoint1 --route-name route1 --cache-configuration "{compression-settings:{content-types-to-compress:[text/html,application/octet-stream],is-compression-enabled:True},query-parameters:querystring=test,query-string-caching-behavior:IgnoreSpecifiedQueryStrings}" --formatted-custom-domains "[{id:/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1}]" --enabled-state Enabled --forwarding-protocol MatchRequest --https-redirect Enabled --link-to-default-domain Enabled --origin-group /subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1 --origin-path None --patterns-to-match "[/*]" --formatted-rule-sets "[{id:/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1}]" --supported-protocols "[Https,Http]"
Required Parameters
Name of the endpoint under the profile which is unique globally.
Name of the routing rule.
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>.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The caching configuration for this route. To disable caching, do not provide a cacheConfiguration object. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
| Accepted values: | Disabled, Enabled |
Domains referenced by this endpoint. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
Rule sets referenced by this endpoint. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
Protocol this rule will use when forwarding traffic to backends.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
| Default value: | MatchRequest |
| Accepted values: | HttpOnly, HttpsOnly, MatchRequest |
Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way to set up this rule and it will be the first rule that gets executed.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
| Default value: | Disabled |
| Accepted values: | Disabled, Enabled |
Whether this route will be linked to the default endpoint domain.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
| Default value: | Disabled |
| Accepted values: | Disabled, Enabled |
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 or ID of the origin group to be associated with.
| Property | Value |
|---|---|
| Parameter group: | OriginGroup Arguments |
A directory path on the origin that AzureFrontDoor can use to retrieve content from, e.g. contoso.cloudapp.net/originpath.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
The route patterns of the rule. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
List of supported protocols for this route. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
| Default value: | ['Http', 'Https'] |
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 route delete
Delete an existing route with the specified route name under the specified subscription, resource group, profile, and AzureFrontDoor endpoint.
az afd route delete [--acquire-policy-token]
[--change-reference]
[--endpoint-name]
[--ids]
[--name --route-name]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--profile-name]
[--resource-group]
[--subscription]
[--yes]
Examples
Routes_Delete
az afd route delete --resource-group RG --profile-name profile1 --endpoint-name endpoint1 --route-name route1
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Name of the endpoint under the profile which is unique globally.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
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 routing rule.
| 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 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 route list
List all of the existing origins within a profile.
az afd route list --endpoint-name
--profile-name
--resource-group
[--max-items]
[--next-token]
Examples
Routes_ListByEndpoint
az afd route list --resource-group RG --profile-name profile1 --endpoint-name endpoint1
Required Parameters
Name of the endpoint under the profile which is unique globally.
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>.
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 route show
Get an existing route with the specified route name under the specified subscription, resource group, profile, and AzureFrontDoor endpoint.
az afd route show [--endpoint-name]
[--ids]
[--name --route-name]
[--profile-name]
[--resource-group]
[--subscription]
Examples
Routes_Get
az afd route show --resource-group RG --profile-name profile1 --endpoint-name endpoint1 --route-name route1
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Name of the endpoint under the profile which is unique globally.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
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 routing rule.
| 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 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 route update
Update a new route with the specified route name under the specified subscription, resource group, profile, and AzureFrontDoor endpoint.
az afd route update [--acquire-policy-token]
[--add]
[--cache-configuration]
[--change-reference]
[--enabled-state {Disabled, Enabled}]
[--endpoint-name]
[--force-string {0, 1, f, false, n, no, t, true, y, yes}]
[--formatted-custom-domains]
[--formatted-rule-sets]
[--forwarding-protocol {HttpOnly, HttpsOnly, MatchRequest}]
[--https-redirect {Disabled, Enabled}]
[--ids]
[--link-to-default-domain {Disabled, Enabled}]
[--name --route-name]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--origin-group]
[--origin-path]
[--patterns-to-match]
[--profile-name]
[--remove]
[--resource-group]
[--set]
[--subscription]
[--supported-protocols]
Examples
Routes_Create
az afd route update --resource-group RG --profile-name profile1 --endpoint-name endpoint1 --route-name route1 --cache-configuration "{compression-settings:{content-types-to-compress:[text/html,application/octet-stream],is-compression-enabled:True},query-parameters:querystring=test,query-string-caching-behavior:IgnoreSpecifiedQueryStrings}" --formatted-custom-domains "[{id:/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/customDomains/domain1}]" --enabled-state Enabled --forwarding-protocol MatchRequest --https-redirect Enabled --link-to-default-domain Enabled --origin-group /subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/originGroups/originGroup1 --origin-path None --patterns-to-match "[/*]" --formatted-rule-sets "[{id:/subscriptions/subid/resourceGroups/RG/providers/Microsoft.Cdn/profiles/profile1/ruleSets/ruleSet1}]" --supported-protocols "[Https,Http]"
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy 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 |
The caching configuration for this route. To disable caching, do not provide a cacheConfiguration object. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
| Accepted values: | Disabled, Enabled |
Name of the endpoint under the profile which is unique globally.
| Property | Value |
|---|---|
| Parameter group: | Resource Id 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 |
Domains referenced by this endpoint. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
Rule sets referenced by this endpoint. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
Protocol this rule will use when forwarding traffic to backends.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
| Accepted values: | HttpOnly, HttpsOnly, MatchRequest |
Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way to set up this rule and it will be the first rule that gets executed.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
| Accepted values: | Disabled, Enabled |
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 |
Whether this route will be linked to the default endpoint domain.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
| Accepted values: | Disabled, Enabled |
Name of the routing rule.
| 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 or ID of the origin group to be associated with.
| Property | Value |
|---|---|
| Parameter group: | OriginGroup Arguments |
A directory path on the origin that AzureFrontDoor can use to retrieve content from, e.g. contoso.cloudapp.net/originpath.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
The route patterns of the rule. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| 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 |
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 |
List of supported protocols for this route. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties 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 route wait
Place the CLI in a waiting state until a condition is met.
az afd route wait [--acquire-policy-token]
[--change-reference]
[--created]
[--custom]
[--deleted]
[--endpoint-name]
[--exists]
[--ids]
[--interval]
[--name --route-name]
[--profile-name]
[--resource-group]
[--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.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
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 |
Name of the endpoint under the profile which is unique globally.
| Property | Value |
|---|---|
| Parameter group: | Resource Id Arguments |
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 routing rule.
| 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 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 |