Deleting a front door backend by address, not index in the Azure CLI

Brett McKenzie 51 Reputation points
2020-12-21T03:01:14.447+00:00

Using the Azure CLI, I would like to remove a series of backends from a Front Door backend pool based on their address. But from what I can tell you need to know the position of the backends in the list (the index) rather than pick from the address.

I am using az network front-door backend-pool backend list to get the list of backends, the response does not provide an index to use.

  • Can I remove a backend by the address, or some other identifier, rather than an index?

If I am forced to delete by index:

  • If I list the backends multiple times, can I be guaranteed that they always come back in the same order?
  • If I add a new backend to the pool, is it always the last in the list, and therefore the highest index?
  • If I delete the first backend (index = 1), does that index get replaced with the next in the list?
Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
622 questions
0 comments No comments
{count} votes

Accepted answer
  1. suvasara-MSFT 10,026 Reputation points
    2020-12-21T09:08:57.133+00:00

    @Brett McKenzie ,

    Can I remove a backend by the address, or some other identifier, rather than an index?

    as of today, Azure cli supports removing backends using index. You can raise a feature request here in this feedback section for its future availability. Also, I feel that this feature update might not help in case If there are same backend addresses with different ports (Same IP Diff Port concept).

    As a work around you can even try using JQ for parsing and editing the JSON script generated using Azure CLI. But, not sure whether the backend API's will allow so.

    I am using az network front-door backend-pool backend list to get the list of backends, the response does not provide an index to use.

    --> Yes, the list provide the JSON output with no Index value before the blocks. Generally, Index starts from "0" and the count goes on depending on your backends.

    If I list the backends multiple times, can I be guaranteed that they always come back in the same order?

    --> I have tested this In my lab, where I can see the order never jumbled. It follows the portal.

    If I add a new backend to the pool, is it always the last in the list, and therefore the highest index?

    --> Yes, on adding new backend it will be given the +1 Index number to Its preceder.

    If I delete the first backend (index = 1), does that index get replaced with the next in the list?

    -->Yes, if there are three Indexes say , {0=x,1=y,2=z}, then on deleting Index "1" the value will be shifted left like this {0=x,1=z}.

    ----------

    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.


0 additional answers

Sort by: Most helpful