Azure / Azure/azure-cli

App Gateway Path-based Rule Redirect with Default Backend and Default HTTP Settings

Open
#16,247 5 comments 0 reactions 1 assignee Assigned to @kairu-ms View on GitHub
act-quality-productivity-squad feature-request Network Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### **This is autogenerated. Please review and update as needed.**

## Describe the bug

I am attempting to create a path-based rule with a url-path-map that has a default backend and http settings, but has a specific path redirect rule. This is not possible from az cli. When looking at the arm json, I should be able to specify the DefaultBackendAddressPool and DefaultHTTPSettings on the url-path-map, and then specify a RedirectConfiguration on a url-path-map-rule. However, any combination of attempting to build this configuration within the available cli commands throws an error that it's not possible.

**Command Name**
`az network application-gateway url-path-map update`

**Errors:**
```
BadRequestError: UrlPathMap /subscriptions//resourceGroups//providers/Microsoft.Network/applicationGateways//urlPathMaps/ cannot specify DefaultBackendAddressPool when RedirectConfiguration is specified.
```

## To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Create a url-path-map with the following information:
- `az network application-gateway url-path-map create --name {} --rule-name {} --paths {} --redirect-config {} --resource-group {} --gateway-name {}`

This command sets a default redirect config. It is not possible to add --default-address-pool or --default-http-settings when you specify --redirect-config.

Attempting to update it, does not work:
- `az network application-gateway url-path-map update --name {} --default-address-pool {} --default-http-settings {} --resource-group {} --gateway-name {}`

## Expected Behavior
You should be able to specify a DefaultBackendAddressPool and DefaultHTTPSettings in addition to a url-path-map-rule with redirect configuration from az cli - ideally from one create command if you only have one url-path-map-rule to create.

For example, the following command should work which send all requests by default to the backend with the http settings, except for those specified by the path rule, which are redirected. This is possible from the UI, and is valid arm json.
`az network application-gateway url-path-map create --name {} --rule-name {} --default-address-pool {} --default-http-settings {} --paths {} --redirect-config {} --resource-group {} --gateway-name {}`

## Environment Summary
```
Linux-4.19.128-microsoft-standard-x86_64-with-debian-bullseye-sid
Python 3.6.10
Installer: DEB

azure-cli 2.15.1 and 2.16.0
```
## Additional Context

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.