It seems that the issue you're experiencing with the Azure Application Gateway rewrite rule conditions not matching subpaths using the RequestUri variable may be related to how the Application Gateway evaluates the RequestUri and the specific regex patterns used.
Here are a few points to consider:
- Regex Evaluation: The regex pattern you've used,
^/v2/10(/.*)?$, should theoretically match both/v2/10and any subpaths like/v2/10/access. However, ensure that the regex is correctly interpreted by the Application Gateway. Sometimes, slight variations in regex syntax or escaping might lead to unexpected results. - Trailing Slashes: If the requests might include trailing slashes (e.g.,
/v2/10/), consider modifying your regex to account for that. You could try a pattern like^/v2/10(/.*)?/?$to capture both cases. - Case Sensitivity: Ensure that the case sensitivity settings are appropriate for your conditions. If the incoming requests have different casing, they may not match.
- Testing with Different Patterns: Since you've already tested with various regex patterns, ensure that the conditions are being applied correctly. You might want to simplify the regex temporarily to see if any matches occur at all, such as
^/v2/10to confirm that the rule is being triggered. - Application Gateway Configuration: Double-check that the rewrite rule is correctly associated with the listener and that there are no conflicting rules that might prevent the expected behavior.
If you've already verified these aspects and the issue persists, it may be beneficial to review the Application Gateway logs or consult Azure support for further assistance.