Azure / azure-cli

Azure Command-Line Interface
MIT License
3.99k stars 2.97k forks source link

"az network firewall policy rule-collection-group show" does not show location property #27213

Open kshimazu-ms opened 1 year ago

kshimazu-ms commented 1 year ago

Describe the bug

"az network firewall policy rule-collection-group show" does not show location property as below.

{ "etag": "xxx", "id": "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/firewallPolicies/xxx/ruleCollectionGroups/DefaultNetworkRuleCollectionGroup", "name": "DefaultNetworkRuleCollectionGroup", "priority": 200, "provisioningState": "Succeeded", "resourceGroup": "xxx", "ruleCollections": [ { "action": { "type": "Allow" }, "name": "fw_collection_network", "priority": 110, "ruleCollectionType": "FirewallPolicyFilterRuleCollection", "rules": [ { "destinationAddresses": [], "destinationFqdns": [], "destinationIpGroups": [ "/subscriptions/xxx/resourceGroups/azure-rg/providers/Microsoft.Network/ipGroups/xxx" ], "destinationPorts": [ "" ], "ipProtocols": [ "UDP", "ICMP", "TCP" ], "name": "all-allow", "ruleType": "NetworkRule", "sourceAddresses": [ "" ], "sourceIpGroups": [] } ] } ], "type": "Microsoft.Network/FirewallPolicies/RuleCollectionGroups" }

However, the location property was successfully responded from the API call with --debug. xxx@Azure:~$ az network firewall policy rule-collection-group show -g xxx --policy-name xxx--name DefaultNetworkRuleCollectionGroup --debug

cli.azure.cli.core.sdk.policies: Response headers: cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache' cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache' cli.azure.cli.core.sdk.policies: 'Transfer-Encoding': 'chunked' cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8' cli.azure.cli.core.sdk.policies: 'Content-Encoding': 'gzip' cli.azure.cli.core.sdk.policies: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'ETag': '"xxx"' cli.azure.cli.core.sdk.policies: 'Vary': 'Accept-Encoding' cli.azure.cli.core.sdk.policies: 'Server': 'Microsoft-HTTPAPI/2.0' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-reads': '11998' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': 'xxx' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': 'xxx' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'SOUTHEASTASIA:xxx' cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains' cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff' cli.azure.cli.core.sdk.policies: 'Date': 'Mon, 21 Aug 2023 12:37:45 GMT' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: { "properties": { "priority": 200, "ruleCollections": [ { "ruleCollectionType": "FirewallPolicyFilterRuleCollection", "action": { "type": "Allow" }, "rules": [ { "ruleType": "NetworkRule", "ipv6Rule": false, "name": "all-allow", "ipProtocols": [ "UDP", "ICMP", "TCP" ], "sourceAddresses": [ "*" ], "sourceIpGroups": [], "destinationAddresses": [], "destinationIpGroups": [ "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/ipGroups/IPG-1" ], "destinationFqdns": [], "destinationPorts": [ "*" ] } ], "name": "fw_collection_network", "priority": 110 } ], "provisioningState": "Succeeded" }, "id": "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/firewallPolicies/xxx/ruleCollectionGroups/DefaultNetworkRuleCollectionGroup", "name": "DefaultNetworkRuleCollectionGroup", "type": "Microsoft.Network/FirewallPolicies/RuleCollectionGroups", "etag": "xxx", "location": "eastus" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< } cli.knack.cli: Event: CommandInvoker.OnTransformResult [, ] cli.knack.cli: Event: CommandInvoker.OnFilterResult [] { ### Related command az network firewall policy rule-collection-group show -g xxx --policy-name xxx --name xxx ### Errors No error displayed ### Issue script & Debug output xxx@Azure:~$ az network firewall policy rule-collection-group show -g azure-rg --policy-name FW-policy --name DefaultNetworkRuleCollectionGroup --debug cli.knack.cli: __init__ debug log: Enable color in terminal. cli.knack.cli: Event: Cli.PreExecute [] cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [, , ] cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] cli.azure.cli.core: Modules found from index for 'network': ['azure.cli.command_modules.network', 'azure.cli.command_modules.privatedns', 'azext_firewall'] cli.azure.cli.core: Loading command modules: cli.azure.cli.core: Name Load Time Groups Commands cli.azure.cli.core: network 0.512 114 353 cli.azure.cli.core: privatedns 0.009 14 63 cli.azure.cli.core: Total (2) 0.522 128 416 cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_next'] cli.azure.cli.core: Loading extensions: cli.azure.cli.core: Name Load Time Groups Commands Directory cli.azure.cli.core: ai-examples 0.063 1 1 /usr/lib/python3.9/site-packages/azure-cli-extensions/ai-examples cli.azure.cli.core: azure-firewall 0.017 16 61 /home/xxx/.azure/cliextensions/azure-firewall cli.azure.cli.core: Total (2) 0.080 17 62 cli.azure.cli.core: Loaded 143 groups, 478 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : network firewall policy rule-collection-group show cli.azure.cli.core: Command table: network firewall policy rule-collection-group show cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/xxx/.azure/commands/2023-08-21.12-37-44.network_firewall_policy_rule-collection-group_show.304.log'. az_command_data_logger: command args: network firewall policy rule-collection-group show -g {} --policy-name {} --name {} --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [.add_subscription_parameter at 0x7f31e8d6d040>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [.add_ids_arguments at 0x7f31e8d4b0d0>, .add_cache_arguments at 0x7f31e8d56ee0>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [, , .parse_ids_arguments at 0x7f31e8d56e50>] az_command_data_logger: extension name: azure-firewall az_command_data_logger: extension version: 1.0.0 This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus urllib3.connectionpool: Starting new HTTP connection (1): localhost:50342 urllib3.connectionpool: http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 2320 msrestazure.azure_active_directory: MSI: Retrieving a token from http://localhost:50342/oauth2/token, with payload {'resource': 'https://management.core.windows.net/'} cli.azure.cli.core.auth.adal_authentication: MSIAuthenticationWrapper.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={} urllib3.connectionpool: Starting new HTTP connection (1): localhost:50342 urllib3.connectionpool: http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 2320 msrestazure.azure_active_directory: MSI: Retrieving a token from http://localhost:50342/oauth2/token, with payload {'resource': 'https://management.core.windows.net/'} cli.azure.cli.core.auth.adal_authentication: Normalize expires_on: '1692623876' -> 1692623876 cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/firewallPolicies/xxx/ruleCollectionGroups/DefaultNetworkRuleCollectionGroup?api-version=2022-01-01' cli.azure.cli.core.sdk.policies: Request method: 'GET' cli.azure.cli.core.sdk.policies: Request headers: cli.azure.cli.core.sdk.policies: 'Accept': 'application/json' cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': 'xxx' cli.azure.cli.core.sdk.policies: 'CommandName': 'network firewall policy rule-collection-group show' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '-g --policy-name --name --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.51.0 (RPM) (AAZ) azsdk-python-core/1.26.0 Python/3.9.14 (Linux-5.4.0-1109-azure-x86_64-with-glibc2.35) cloud-shell/1.0' cli.azure.cli.core.sdk.policies: 'Authorization': '*****' cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: This request has no body urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443 urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/firewallPolicies/xxx/ruleCollectionGroups/DefaultNetworkRuleCollectionGroup?api-version=2022-01-01 HTTP/1.1" 200 None cli.azure.cli.core.sdk.policies: Response status: 200 cli.azure.cli.core.sdk.policies: Response headers: cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache' cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache' cli.azure.cli.core.sdk.policies: 'Transfer-Encoding': 'chunked' cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8' cli.azure.cli.core.sdk.policies: 'Content-Encoding': 'gzip' cli.azure.cli.core.sdk.policies: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'ETag': '"xxx"' cli.azure.cli.core.sdk.policies: 'Vary': 'Accept-Encoding' cli.azure.cli.core.sdk.policies: 'Server': 'Microsoft-HTTPAPI/2.0' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-reads': '11998' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': 'xxx' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': 'xxx' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'SOUTHEASTASIA:xxx' cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains' cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff' cli.azure.cli.core.sdk.policies: 'Date': 'Mon, 21 Aug 2023 12:37:45 GMT' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: { "properties": { "priority": 200, "ruleCollections": [ { "ruleCollectionType": "FirewallPolicyFilterRuleCollection", "action": { "type": "Allow" }, "rules": [ { "ruleType": "NetworkRule", "ipv6Rule": false, "name": "all-allow", "ipProtocols": [ "UDP", "ICMP", "TCP" ], "sourceAddresses": [ "*" ], "sourceIpGroups": [], "destinationAddresses": [], "destinationIpGroups": [ "/subscriptions/xxx/resourceGroups/azure-rg/providers/Microsoft.Network/ipGroups/xxx" ], "destinationFqdns": [], "destinationPorts": [ "*" ] } ], "name": "fw_collection_network", "priority": 110 } ], "provisioningState": "Succeeded" }, "id": "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/firewallPolicies/xxx/ruleCollectionGroups/DefaultNetworkRuleCollectionGroup", "name": "DefaultNetworkRuleCollectionGroup", "type": "Microsoft.Network/FirewallPolicies/RuleCollectionGroups", "etag": "xxx", "location": "eastus" >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> } cli.knack.cli: Event: CommandInvoker.OnTransformResult [, ] cli.knack.cli: Event: CommandInvoker.OnFilterResult [] { { "etag": "xxx", "id": "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/firewallPolicies/xxx/ruleCollectionGroups/DefaultNetworkRuleCollectionGroup", "name": "DefaultNetworkRuleCollectionGroup", "priority": 200, "provisioningState": "Succeeded", "resourceGroup": "azure-rg", "ruleCollections": [ { "action": { "type": "Allow" }, "name": "fw_collection_network", "priority": 110, "ruleCollectionType": "FirewallPolicyFilterRuleCollection", "rules": [ { "destinationAddresses": [], "destinationFqdns": [], "destinationIpGroups": [ "/subscriptions/xxx/resourceGroups/azure-rg/providers/Microsoft.Network/ipGroups/xxx" ], "destinationPorts": [ "*" ], "ipProtocols": [ "UDP", "ICMP", "TCP" ], "name": "all-allow", "ruleType": "NetworkRule", "sourceAddresses": [ "*" ], "sourceIpGroups": [] } ] } ], "type": "Microsoft.Network/FirewallPolicies/RuleCollectionGroups" } cli.knack.cli: Event: Cli.SuccessfulExecute [] cli.knack.cli: Event: Cli.PostExecute [] az_command_data_logger: exit code: 0 cli.__main__: Command ran in 2.382 seconds (init: 0.126, invoke: 2.255) telemetry.main: Begin splitting cli events and extra events, total events: 1 telemetry.client: Accumulated 0 events. Flush the clients. telemetry.main: Finish splitting cli events and extra events, cli events: 1 telemetry.save: Save telemetry record of length 3561 in cache telemetry.main: Begin creating telemetry upload process. telemetry.process: Creating upload process: "/usr/bin/python3.9 /usr/lib/az/lib/python3.9/site-packages/azure/cli/telemetry/__init__.py /home/xxx/.azure" telemetry.process: Return from creating process telemetry.main: Finish creating telemetry upload process. ### Expected behavior locaiton property should be displayed. ### Environment Summary azure-cli 2.51.0 core 2.51.0 telemetry 1.1.0 Extensions: ai-examples 0.2.5 azure-firewall 1.0.0 ml 2.19.1 ssh 2.0.1 Dependencies: msal 1.24.0b1 azure-mgmt-resource 23.1.0b2 Python location '/usr/bin/python3.9' Extensions directory '/home/xxx/.azure/cliextensions' Extensions system directory '/usr/lib/python3.9/site-packages/azure-cli-extensions' Python (Linux) 3.9.14 (main, Feb 8 2023, 03:39:52) [GCC 11.2.0] Legal docs and information: aka.ms/AzureCliLegal Your CLI is up-to-date. ### Additional context _No response_
yonzhan commented 1 year ago

Thank you for opening this issue, we will look into it.