Azure / azure-cli

Azure Command-Line Interface
MIT License
3.98k stars 2.96k forks source link

Cannot Delete Application Gateway redirect-config #10870

Open shelwig opened 4 years ago

shelwig commented 4 years ago

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug The portal allows creation of a Redirect Config but not deletion. In attempting to do so using the CLI I receive and error despite entering the proper commands.

To Reproduce

  1. Create an application gateway and path based rule.
  2. Create a redirect-config
  3. Attempt to delete redirect config using the CLI with the following command: az network application-gateway redirect-config delete -g MyResourceGroup --gateway-name MyAppGateway -n MyRedirectConfig

Received the following error:

Resource /subscriptions/{subscriptionId}/resourceGroups/rg-appgateway-test/providers/Microsoft.Network/applicationGateways/shgatewaytest/redirectConfigurations/LetsEncryptChallenge referenced by resource /subscriptions/{subscriptionId}/resourceGroups/rg-appgateway-test/providers/Microsoft.Network/applicationGateways/shgatewaytest/urlPathMaps/default-path/pathRules/LetsEncryptChallenge was not found. Please make sure that the referenced resource exists, and that both resources are in the same region.

Expected behavior The redirect config should be deleted.

Environment summary Tried with Azure CLI both in Portal and locally through bash.

Additional context Redirect config initially created in the portal.

mmyyrroonn commented 4 years ago

@shelwig Hello. I will take a look later. We're quite busy for Ignite. So it may take some time for me to take at this issue. Thanks.

haroldrandom commented 4 years ago

Hi @shelwig, I follow the instructions you gave, cannot reproduce your situation.

  1. I created an application-gateway and associate a redirect-config with it.
  2. I deleted it and test the return code of the command line.
  3. I deleted it again, and the backend told me that previous-deleted redirect-config didn't exist. So I did delete that redirect-config. Below are my results: Jietu20191102-224042

Maybe you type the wrong redirect-config name? Or maybe the version of azure-cli you are using is out of date? Please make sure of it.

I tested in:

haroldrandom commented 4 years ago

Closed as long time no response. Feel feel reoen~^_^

mariomann commented 4 years ago

Please reopen the ticket!

I've the same problem. I created redirections in azure portal and cannot delete it. The portal doesn't provide any delete function (unfortunately). So I tried to delete it with the azure cli but without any success.

With the "show" command the redirect config was found:

Bildschirmfoto 2019-12-05 um 12 29 46

But with the "delete" command the redirect config wasn't found:

Bildschirmfoto 2019-12-05 um 12 34 18

I tested in:

`az --version azure-cli 2.0.77

command-modules-nspkg 2.0.3 core 2.0.77 nspkg 3.0.4 telemetry 1.0.4

Python location '/usr/local/Cellar/azure-cli/2.0.77/libexec/bin/python' Extensions directory '/Users/****/.azure/cliextensions'

Python (Darwin) 3.7.5 (default, Nov 1 2019, 02:16:38) [Clang 10.0.0 (clang-1000.11.45.5)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.`

haroldrandom commented 4 years ago

@mariomann What about show by name?

mariomann commented 4 years ago

Hi @haroldrandom

the show by name command? Has the same output like the show by ids command.

Bildschirmfoto 2019-12-09 um 09 40 38

Delete a config rule with the name is also not possible.

haroldrandom commented 4 years ago

@mariomann based on your output, did you reference the redirect-config in a urlPathMap under other location? And then it was deleted by accident?

I guess it's caused by resource reference problem. Or the creation failed of redirect-config.

Still cannot reproduce again.

ghost commented 4 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @aznetsuppgithub.

haroldrandom commented 4 years ago

@aznetsuppgithub could you help here?

ceilingfish commented 2 years ago

Hello there, same issue.

I also noted that I'm not able to modify the redirect-config either. e.g. trying to set the redirect type to External in the UI has no effect.