Azure / azure-cli

Azure Command-Line Interface
MIT License
3.95k stars 2.93k forks source link

Incorrect description for `az redis firewall-rules list` #19543

Open AlphaWong opened 2 years ago

AlphaWong commented 2 years ago

background

I try to export all the firewall rules via azure cli

command

az redis firewall-rules list -g my-resource -n my-redis-name

expected

It will list out all the firewall rules based on the -g and -n across diff subscription

actual

It only searches the resources from the default subscription with -g and -n criteria

resolution

change this line img

--subscription
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Please specify it, otherwise, only the default subscription will be searched.

reason

Unlike the az mysql server firewall-rule list [--ids] we can offer the ids to filter the targeted resources. It does not share the same behaviors. An engineer like me cannot filter a resource from the resource id directly.

It is better to support az redis firewall-rules list --ids my-resource-id0,my-resource-id1

references

  1. https://docs.microsoft.com/en-us/cli/azure/mysql/server/firewall-rule?view=azure-cli-latest#az_mysql_server_firewall_rule_list

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

AlphaWong commented 2 years ago

We should put the mysql firewall rules line

...
query_parameters['queryIds'] = [self._serialize.query("query_ids", q, 'str') if q is not None else '' for q in query_ids]
request = self._client.get(url, query_parameters, header_parameters)
...

https://github.com/Azure/azure-sdk-for-python/blob/42f9ba1c2b550193d7cd10c03b448e2ee6fd9094/sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/operations/_query_texts_operations.py#L157

to redis firewall lib as well to support filter items by ids

like

az redis firewall-rules list --ids my-resource-id0,my-resource-id1
ghost commented 2 years ago

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

Issue Details
# background I try to export all the firewall rules via azure cli # command `az redis firewall-rules list -g my-resource -n my-redis-name` # expected It will list out all the firewall rules based on the `-g` and `-n` across diff subscription # actual It only searches the resources from the default subscription with `-g` and `-n` criteria # resolution change this line ![img](https://upload.cc/i1/2021/09/13/utd3o9.png) ``` --subscription Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID. Please specify it, otherwise, only the default subscription will be searched. ``` # reason Unlike the `az mysql server firewall-rule list [--ids]` we can offer the ids to filter the targeted resource. It does not share the same behaviors. An engineer like me only can list cannot filter a resource from the `resource id` directly. It is better to support `az redis firewall-rules list --ids my-resource-id0,my-resource-id1` ## references 1. https://docs.microsoft.com/en-us/cli/azure/mysql/server/firewall-rule?view=azure-cli-latest#az_mysql_server_firewall_rule_list --- #### Document Details ⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.* * ID: a46d79d4-8d2a-5e62-0e5b-33b6f0b04823 * Version Independent ID: eae0fda6-6565-a785-8a8e-74626711d525 * Content: [az redis firewall-rules](https://docs.microsoft.com/en-us/cli/azure/redis/firewall-rules?view=azure-cli-latest#az_redis_firewall_rules_list) * Content Source: [latest/docs-ref-autogen/redis/firewall-rules.yml](https://github.com/MicrosoftDocs/azure-docs-cli/blob/master/latest/docs-ref-autogen/redis/firewall-rules.yml) * Service: **cache** * GitHub Login: @rloutlaw * Microsoft Alias: **routlaw**
Author: AlphaWong
Assignees: -
Labels: `Redis Cache`, `Service Attention`, `customer-reported`
Milestone: -
yonzhan commented 2 years ago

route to service team

navba-MSFT commented 2 years ago

@AlphaWong Apologies for the late reply. The default behavior of the above command is to list the redis firewall rules from the default subscription, unless you provide one as a parameter. I am looking into this issue and I will update this thread once I have more details.

ghost commented 2 years ago

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

Issue Details
# background I try to export all the firewall rules via azure cli # command `az redis firewall-rules list -g my-resource -n my-redis-name` # expected It will list out all the firewall rules based on the `-g` and `-n` across diff subscription # actual It only searches the resources from the default subscription with `-g` and `-n` criteria # resolution change this line ![img](https://upload.cc/i1/2021/09/13/utd3o9.png) ``` --subscription Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID. Please specify it, otherwise, only the default subscription will be searched. ``` # reason Unlike the `az mysql server firewall-rule list [--ids]` we can offer the ids to filter the targeted resources. It does not share the same behaviors. An engineer like me cannot filter a resource from the `resource id` directly. It is better to support `az redis firewall-rules list --ids my-resource-id0,my-resource-id1` ## references 1. https://docs.microsoft.com/en-us/cli/azure/mysql/server/firewall-rule?view=azure-cli-latest#az_mysql_server_firewall_rule_list --- #### Document Details ⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.* * ID: a46d79d4-8d2a-5e62-0e5b-33b6f0b04823 * Version Independent ID: eae0fda6-6565-a785-8a8e-74626711d525 * Content: [az redis firewall-rules](https://docs.microsoft.com/en-us/cli/azure/redis/firewall-rules?view=azure-cli-latest#az_redis_firewall_rules_list) * Content Source: [latest/docs-ref-autogen/redis/firewall-rules.yml](https://github.com/MicrosoftDocs/azure-docs-cli/blob/master/latest/docs-ref-autogen/redis/firewall-rules.yml) * Service: **cache** * GitHub Login: @rloutlaw * Microsoft Alias: **routlaw**
Author: AlphaWong
Assignees: -
Labels: `Redis Cache`, `Service Attention`, `customer-reported`
Milestone: -
navba-MSFT commented 2 years ago

@shariq-mcs @MSFTeegarden Could you please provide an update on this once you get a chance ?