Azure / Azure/azure-cli

Application Gateway - unable to create a routing rule with backend pool and redirect configuration

Open
#20,105 3 comments 0 reactions 2 assignees Claimed by @necusjz View on GitHub
act-quality-productivity-squad customer-reported feature-request Network
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.

![image](https://user-images.githubusercontent.com/19637042/139390264-285a69ff-1db8-4e8c-9801-ac73b2bdb0d2.png)

**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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.