Azure Front Door: Rule Set Rule UrlRedirect will not accept more than 11 matchValues

philippe.savary 20 Reputation points
2024-10-14T20:56:05.6+00:00

When using the API for AFD through the node js package @azure/arm-cdn i get the following Error when i push a Redirect Rule with more than 11 Items:

The number of elements within the collection 'Rule.Conditions[0].Parameters.MatchValues' are not within the minimum and maximum acceptable range for number of elements [0-10].
RestError: The number of elements within the collection 'Rule.Conditions[0].Parameters.MatchValues' are not within the minimum and maximum acceptable range for number of elements [0-10].

This is the code in question:

import { CdnManagementClient, KnownRedirectType, Rule } 

const credential = 
client 

await client.rules.beginCreateAndWait(
                    this.resourceGroupName,
                    this.frontDoorName,
                    this.rulesEngineName,
                    key,
                    redirectRule,
                );

The redirectRule looks like this:

{
            actions: [
                {
                    name: 'UrlRedirect',
                    parameters: {
                        typeName: 'DeliveryRuleUrlRedirectActionParameters',
                        redirectType: records[0].redirectType ? records[0].redirectType : 'Moved',
                        destinationProtocol: 'Https',
                        customHostname: records[0].destinationUrl?.hostname,
                        customPath: records[0].destinationUrl?.pathname,
                    },
                },
            ],
            conditions: [
                {
                    name: 'RequestUri',
                    parameters: {
                        operator: 'Equal',
                        typeName: 'DeliveryRuleRequestUriConditionParameters',
                        matchValues, //this has a max lenght of 11!
                    },
                },
            ],
            order: 1,
        };
    }

It seems the error is on the API level and not in the SDK. Please help, since I want to match more than 11 incoming paths to a common destination path.

Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
692 questions
{count} votes

Accepted answer
  1. Ganesh Patapati 1,275 Reputation points Microsoft Vendor
    2024-10-23T18:12:33.86+00:00

    Hey philippe.savary

    We appreciate your patience

    Web application firewall string match values per match condition10Web application firewall string match values per match condition10- https://github.com/MicrosoftDocs/azure-docs/blob/main/includes/front-door-limits.md

    As per the document you mentioned above it can match up to 10 values.

    • While Azure Front Door is a powerful service, its limitations can pose challenges for complex redirect scenarios, especially for SEO purposes.

    NOTE: As this something which is not supported. We encourage customers to create a feedback item for this request on the feedback forum


    Hope this clarifies, please let me know is this resolve your issue or not?

    Thanks

    Ganesh

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.