Application Gateway - unable to create a routing rule with backend pool and redirect configuration
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
**Describe the bug**
Unable to create path-based routing rule (backend targets) of target type "Backend pool" and using it with redirect rules.
This scenario is achievable only via Portal and cannot be automated in any way. (not even from AGIC level).
**To Reproduce**
1. Create redirect config:
```
az network application-gateway redirect-config create -g \
--gateway-name -n --type Permanent \
--include-path true --include-query-string true --target-url https://google.com
```
2. Create URL path map
```
az network application-gateway url-path-map create \
--gateway-name \
--name \
--paths /test-path/* \
--resource-group \
--redirect-config
```
3. Create a routing rule
```
az network application-gateway rule create \
--gateway-name \
--name \
--resource-group \
--http-listener \
--rule-type PathBasedRouting \
--url-path-map \
--address-pool \
--http-settings
```
Those steps end with following error:
```
(ApplicationGatewayRedirectConfigurationPathRuleCannotReference) Path Rule /subscriptions//resourceGroups//providers/Microsoft.Network/applicationGateways//urlPathMaps//pathRules/ cannot reference a BackendHttpSettings when Redirect Setting is specified.
```
**Expected behavior**
The user should be able to achieve the following configuration as on screenshot through az cli.

**Environment summary**
CLI version - 2.29.1 / Windows 10 / Git Bash
**Additional context**
I tried also using https://docs.microsoft.com/en-us/cli/azure/network/application-gateway/url-path-map/rule?view=azure-cli-latest but unfortunately, this approach did not work also.
Contributor guide
Assessment
This issue has not been assessed yet.