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.