Why does a Azure Front Door Rule Set Rule has an Order instead of a Weight?

philippe.savary 20 Reputation points
2024-10-15T06:23:49.5666667+00:00

When I programatically create Rules, it shows me that:

The delivery rules order values cannot have duplicates. RestError: The delivery rules order values cannot have duplicates.

Why is that? If I have to update a Rule Set this is really hard on me to find an Order number that is not duplicated (additional requests on the API). Would it be not more beneficial to use a Weight instead so that several Rules can have the same weight like when a path hat the same "depth"?

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

1 answer

Sort by: Most helpful
  1. Deepanshukatara-6769 10,765 Reputation points
    2024-10-15T06:29:10.21+00:00

    Hello, Welcome to MS Q&A

    Azure Front Door does not allow duplicate order values for delivery rules because each rule must have a unique priority value to ensure that the rules are processed in the correct sequence. This uniqueness prevents conflicts in rule evaluation and ensures that the system can determine which rule to apply first when multiple rules are triggered.

    References:

    1. Incremental Order Assignment: Start with an initial order value and increment it for each new rule.
    2. Check Existing Rules: Retrieve the existing rules and their order values, then assign a new order value that is not already in use.
    3. Use a Hashing Mechanism: Generate a unique hash based on rule properties and use it as the order value.

    By ensuring that each rule has a unique order value, you can avoid the error and ensure that your rules are processed correctly.

    Please let us know if any further questions

    Kindly accept answer if it helps

    Thanks

    Deepanshu


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.