Azure / azure-cli

Azure Command-Line Interface
MIT License
4.02k stars 2.99k forks source link

Error while running az network dns zone export command #27391

Open imsiddhartha opened 1 year ago

imsiddhartha commented 1 year ago

Describe the bug

Running az network dns zone export on a DNS zone with an A,AAA or CNAME record with no value then following error would be thrown

Related command

az network dns zone export

Errors

The command failed with an unexpected error. Here is the traceback:

'id'

Traceback (most recent call last):

File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke

File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 663, in execute

File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 726, in _run_jobs_serially

File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 697, in _run_job

File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 333, in call

File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler

File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/network/custom.py", line 2622, in export_zone

KeyError: 'id'

Issue script & Debug output

az network dns zone export -g ssaklecha -n ssaklecha.com --debug cli.knack.cli: Command arguments: ['network', 'dns', 'zone', 'export', '-g', 'ssaklecha', '-n', 'ssaklecha.com', '--debug'] cli.knack.cli: init debug log: Enable color in terminal. cli.knack.cli: Event: Cli.PreExecute [] cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f9620dce1f0>, <function OutputProducer.on_global_arguments at 0x7f9620ce7d30>, <function CLIQuery.on_global_arguments at 0x7f9620c80310>] 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'] cli.azure.cli.core: Loading command modules: cli.azure.cli.core: Name Load Time Groups Commands cli.azure.cli.core: network 0.499 115 357 cli.azure.cli.core: privatedns 0.014 14 60 cli.azure.cli.core: Total (2) 0.513 129 417 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.062 1 1 /usr/lib/python3.9/site-packages/azure-cli-extensions/ai-examples cli.azure.cli.core: Total (1) 0.062 1 1
cli.azure.cli.core: Loaded 129 groups, 418 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : network dns zone export cli.azure.cli.core: Command table: network dns zone export cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f9620124430>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/siddharth/.azure/commands/2023-09-14.07-01-08.network_dns_zone_export.224.log'. az_command_data_logger: command args: network dns zone export -g {} -n {} --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7f96200cf040>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7f96200bd0d0>, <function register_cache_arguments..add_cache_arguments at 0x7f96200c3ee0>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f9620ce7dc0>, <function CLIQuery.handle_query_parameter at 0x7f9620c803a0>, <function register_ids_argument..parse_ids_arguments at 0x7f96200c3e50>] urllib3.connectionpool: Starting new HTTP connection (1): localhost:50342 urllib3.connectionpool: http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 2401 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 2401 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: '1694679168' -> 1694679168 cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/3425cdc6-4984-4e21-a3e7-aba698d51967/resourceGroups/ssaklecha/providers/Microsoft.Network/dnsZones/ssaklecha.com/recordsets?api-version=2023-07-01-preview' 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': '7a8cd212-52cc-11ee-a50f-baaafbb14664' cli.azure.cli.core.sdk.policies: 'CommandName': 'network dns zone export' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '-g -n --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.52.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/3425cdc6-4984-4e21-a3e7-aba698d51967/resourceGroups/ssaklecha/providers/Microsoft.Network/dnsZones/ssaklecha.com/recordsets?api-version=2023-07-01-preview 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': 'private' 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: 'Vary': 'Accept-Encoding' cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff' cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '7a8cd212-52cc-11ee-a50f-baaafbb14664' cli.azure.cli.core.sdk.policies: 'Server': 'Microsoft-IIS/10.0' cli.azure.cli.core.sdk.policies: 'X-Powered-By': 'ASP.NET' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-resource-requests': '499' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-resource-entities-read': '59979' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '9a9d92b3-0d68-48fc-aa97-7080a037ddfd' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'JIOINDIAWEST:20230914T070109Z:9a9d92b3-0d68-48fc-aa97-7080a037ddfd' cli.azure.cli.core.sdk.policies: 'Date': 'Thu, 14 Sep 2023 07:01:09 GMT' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"value":[{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/NS\/@","name":"@","type":"Microsoft.Network\/dnszones\/NS","etag":"e6bdc134-e3c0-4a1a-a761-ba97876da9dc","properties":{"fqdn":"ssaklecha.com.","TTL":172800,"NSRecords":[{"nsdname":"ns1-34.azure-dns.com."},{"nsdname":"ns2-34.azure-dns.net."},{"nsdname":"ns3-34.azure-dns.org."},{"nsdname":"ns4-34.azure-dns.info."}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/SOA\/@","name":"@","type":"Microsoft.Network\/dnszones\/SOA","etag":"ba87c625-946d-4a00-8ed0-2ad8fd4c4f9d","properties":{"fqdn":"ssaklecha.com.","TTL":300,"SOARecord":{"email":"azuredns-hostmaster.microsoft.com.","expireTime":2419200,"host":"ns1-34.azure-dns.com.","minimumTTL":300,"refreshTime":1600,"retryTime":100,"serialNumber":1},"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/TXT\/atxt","name":"atxt","type":"Microsoft.Network\/dnszones\/TXT","etag":"f90b42cf-b766-4075-a34e-f8637b635d17","properties":{"fqdn":"atxt.ssaklecha.com.","TTL":300,"TXTRecords":[{"value":["\"A text recordOne text recordSecond text record\""]},{"value":["\"Hello World\""]},{"value":["\"3 records\""]},{"value":["\"v=spf1 include:spf.protection.outlook.com\" \"ip4:204.14.232.0\/25 ip4:174.143.99.125 ip4:67.192.157.83 ip4:156.51.31.71 ip4:213.177.33.153 ip4:89.234.41.53 ip4:160.34.64.0\/23\" \"ip4:13.112.93.182 ip4:54.178.172.43 ip4:62.128.223.55 ip4:199.255.192.0\/22 ip4:","199.127.232.0\/22 ip4:54.240.0.0\/18 ip4:84.45.15.6 ip4:188.95.0.38 ip4:188.95.7.6\" \"ip4:89.202.116.58 ip4:80.253.212.192\/27 ip4:194.4.230.64\/27 ip4:205.223.230.229 ip4:62.6.153.165 ip4:208.92.178.200 ip4:208.92.176.200\" \"ip4:208.92.177.152 ip4:54.229.2.165"," ip4:54.153.131.110 ip4:52.1.14.157 ip4:52.30.130.201 ip4:54.66.252.242 ip4:52.17.45.98 ip4:54.173.83.138 ip4:52.16.190.81 ip4:212.247.0.242\/31\" \"ip4:194.204.27.131 ip4:194.204.0.4 ip4:82.199.250.65 ip4:176.74.168.123 ip4:113.192.243.106\/31 ip4:212.72.39.","\" \"68 ip4:212.72.39.197 ip4:50.56.7.39 ip4:185.136.189.88 ip4:185.136.188.88 ip4:134.213.173.64\/28\" \"ip4:162.61.252.6 ip4:162.61.252.7 ip4:162.61.252.27 ip4:43.228.187.74 ip4:141.146.165.0\/27 ip4:64.181.217.128\/27 a:b.spf.service-now.com a:c.spf.service-n","ow.\" \"com a:d.spf.service-now.com include:eu.rp.oracleemaildelivery.com\" \"ip4:174.143.100.191 ip4:18.168.51.200 ip4:18.168.140.58 ip4:194.60.106.150 ip4:194.60.106.152 ip4:128.106.14.225 ip4:128.106.14.227 ip4:204.110.162.26\/31 a:c.spf.service-now.\" \"com ","a:d.spf.service-now.com include:eu.rp.oracleemaildelivery.com\" \"ip4:174.143.100.191 ip4:18.168.51.200 ip4:18.168.140.58 ip4:194.60.106.150 ip4:194.60.106.152 ip4:128.106.14.225 ip4:128.106.14.227 ip4:204.110.162.26\/31 -all\""]}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/TXT\/btxt","name":"btxt","type":"Microsoft.Network\/dnszones\/TXT","etag":"0774a5b6-1bc7-47f7-af1d-954444aebd07","properties":{"fqdn":"btxt.ssaklecha.com.","TTL":300,"TXTRecords":[{"value":["\"v=spf1 include:spf.protection.outlook.com\" \"ip4:204.14.232.0\/25 ip4:174.143.99.125 ip4:67.192.157.83 ip4:156.51.31.71 ip4:213.177.33.153 ip4:89.234.41.53 ip4:160.34.64.0\/23\" \"ip4:13.112.93.182 ip4:54.178.172.43 ip4:62.128.223.55 ip4:199.255.192.0\/22 ip4:","199.127.232.0\/22 ip4:54.240.0.0\/18 ip4:84.45.15.6 ip4:188.95.0.38 ip4:188.95.7.6\" \"ip4:89.202.116.58 ip4:80.253.212.192\/27 ip4:194.4.230.64\/27 ip4:205.223.230.229 ip4:62.6.153.165 ip4:208.92.178.200 ip4:208.92.176.200\" \"ip4:208.92.177.152 ip4:54.229.2.165"," ip4:54.153.131.110 ip4:52.1.14.157 ip4:52.30.130.201 ip4:54.66.252.242 ip4:52.17.45.98 ip4:54.173.83.138 ip4:52.16.190.81 ip4:212.247.0.242\/31\" \"ip4:194.204.27.131 ip4:194.204.0.4 ip4:82.199.250.65 ip4:176.74.168.123 ip4:113.192.243.106\/31 ip4:212.72.39.","68 ip4:212.72.39.197 ip4:50.56.7.39 ip4:185.136.189.88 ip4:185.136.188.88 ip4:134.213.173.64\/28\" \"ip4:162.61.252.6 ip4:162.61.252.7 ip4:162.61.252.27 ip4:43.228.187.74 ip4:141.146.165.0\/27 ip4:64.181.217.128\/27 a:b.spf.service-now.com a:c.spf.service-now.","com a:d.spf.service-now.com include:eu.rp.oracleemaildelivery.com\" \"ip4:174.143.100.191 ip4:18.168.51.200 ip4:18.168.140.58 ip4:194.60.106.150 ip4:194.60.106.152 ip4:128.106.14.225 ip4:128.106.14.227 ip4:204.110.162.26\/31 a:c.spf.service-now.com a:d.spf.s","ervice-now.com include:eu.rp.oracleemaildelivery.com\" \"ip4:174.143.100.191 ip4:18.168.51.200 ip4:18.168.140.58 ip4:194.60.106.150 ip4:194.60.106.152 ip4:128.106.14.225 ip4:128.106.14.227 ip4:204.110.162.26\/31 -all\""]},{"value":["\"the quick brown fox jumps over the lazy dog\""]}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/CAA\/caa","name":"caa","type":"Microsoft.Network\/dnszones\/CAA","etag":"d0efa176-c841-4b60-9fd1-781174e32f35","properties":{"fqdn":"caa.ssaklecha.com.","TTL":300,"caaRecords":[{"flags":2,"tag":"ds","value":"\"ssaklecha\""}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/CAA\/caa2","name":"caa2","type":"Microsoft.Network\/dnszones\/CAA","etag":"3f73a94b-fd47-489e-8214-d105cd606e70","properties":{"fqdn":"caa2.ssaklecha.com.","TTL":300,"caaRecords":[{"flags":3,"tag":"as","value":"\"abc\""}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/CAA\/caa3","name":"caa3","type":"Microsoft.Network\/dnszones\/CAA","etag":"a9f61587-bf06-4e85-83f2-edceaa529911","properties":{"fqdn":"caa3.ssaklecha.com.","TTL":300,"caaRecords":[{"flags":3,"tag":"as","value":"\"gfd\""}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/TXT\/example-spf","name":"example-spf","type":"Microsoft.Network\/dnszones\/TXT","etag":"5c95d1f8-4a78-483f-bf8a-2f4e579c776f","properties":{"fqdn":"example-spf.ssaklecha.com.","TTL":300,"TXTRecords":[{"value":["\"v=spf1 include:_spf.google.com ~all\""]}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/TXT\/example-spf2","name":"example-spf2","type":"Microsoft.Network\/dnszones\/TXT","etag":"3ba9168e-7572-4aef-92b8-0d7e586d07d6","properties":{"fqdn":"example-spf2.ssaklecha.com.","TTL":300,"TXTRecords":[{"value":["\"v=spf1 include:_spf.google.com ~all\""]}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/NS\/iiith","name":"iiith","type":"Microsoft.Network\/dnszones\/NS","etag":"bd1093d6-5247-4468-9907-f086049baa66","properties":{"fqdn":"iiith.ssaklecha.com.","TTL":3600,"NSRecords":[{"nsdname":"ns4-37.azure-dns.info."},{"nsdname":"ns2-37.azure-dns.net."},{"nsdname":"ns1-37.azure-dns.com."},{"nsdname":"ns3-37.azure-dns.org."}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/MX\/mail","name":"mail","type":"Microsoft.Network\/dnszones\/MX","etag":"f045c5fa-54db-4333-8bb5-dfa639f86684","properties":{"fqdn":"mail.ssaklecha.com.","TTL":300,"MXRecords":[{"exchange":"mail.ssaklecha.com.","preference":1}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/MX\/mail2","name":"mail2","type":"Microsoft.Network\/dnszones\/MX","etag":"92a450af-ba9b-48c5-b9e1-72073b2acc13","properties":{"fqdn":"mail2.ssaklecha.com.","TTL":301,"MXRecords":[{"exchange":"mail2conso.com.","preference":3},{"exchange":"mail5.4.","preference":6}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/MX\/mail3","name":"mail3","type":"Microsoft.Network\/dnszones\/MX","etag":"2f068a74-9519-4ce3-83bc-62d82f727a8f","properties":{"fqdn":"mail3.ssaklecha.com.","TTL":301,"MXRecords":[{"exchange":"mail.ssaklecha.net.","preference":1}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/TXT\/064d.mgd","name":"064d.mgd","type":"Microsoft.Network\/dnszones\/TXT","etag":"76d742a7-9cb7-4fa9-9544-7059165abbcc","properties":{"fqdn":"064d.mgd.ssaklecha.com.","TTL":300,"TXTRecords":[{"value":["\"MS=ms61584954MS=ms28313266IB2ltEw9mA7uXg+iyivl8Z1n9hHKJCgFpnQrqcf55A8TkvPC7tDOwA4cCB3TyOcCkeLJmpNAxmhp17ULNHcrqg==MS=ms14977814\""]}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/PTR\/ptr-record","name":"ptr-record","type":"Microsoft.Network\/dnszones\/PTR","etag":"e79e39f9-3579-4f80-93a8-49af0a048784","properties":{"fqdn":"ptr-record.ssaklecha.com.","TTL":300,"PTRRecords":[{"ptrdname":"test.vi."},{"ptrdname":"test.vi.net."}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/SRV\/srv-record","name":"srv-record","type":"Microsoft.Network\/dnszones\/SRV","etag":"35ec4895-0cd3-44fb-930e-a0fa62d62ae4","properties":{"fqdn":"srv-record.ssaklecha.com.","TTL":300,"SRVRecords":[{"port":98,"priority":1,"target":"mpac-delete-300-test.net.","weight":2}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/A\/test-notification","name":"test-notification","type":"Microsoft.Network\/dnszones\/A","etag":"afc2104a-1fd6-42e1-a57e-b19c5d73dd3d","properties":{"fqdn":"test-notification.ssaklecha.com.","TTL":3600,"ARecords":[{"ipv4Address":"23.34.21.21"}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/A\/test-record","name":"test-record","type":"Microsoft.Network\/dnszones\/A","etag":"2c5a6b80-a4d0-45ea-b00b-f54b84f5e620","properties":{"fqdn":"test-record.ssaklecha.com.","TTL":3600,"ARecords":[{"ipv4Address":"1.1.1.1"}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/A\/test2","name":"test2","type":"Microsoft.Network\/dnszones\/A","etag":"825c0ac3-421e-4861-a62a-fedd6e4719d9","properties":{"fqdn":"test2.ssaklecha.com.","TTL":3600,"ARecords":[],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/TXT\/txt","name":"txt","type":"Microsoft.Network\/dnszones\/TXT","etag":"9574419b-7453-480a-abc1-957d5a9ab8d9","properties":{"fqdn":"txt.ssaklecha.com.","TTL":300,"TXTRecords":[{"value":["\"Hi Hello World\" \"Hii\" \"Hello\" \"I am new line\" \"Second new line\" \"ssaklecha\" \"siddharth\" \"saklecha\""]}],"targetResource":{},"provisioningState":"Succeeded"}},{"id":"\/subscriptions\/3425cdc6-4984-4e21-a3e7-aba698d51967\/resourceGroups\/ssaklecha\/providers\/Microsoft.Network\/dnszones\/ssaklecha.com\/TXT\/txt2","name":"txt2","type":"Microsoft.Network\/dnszones\/TXT","etag":"c9f574c2-2f37-43b6-ac5b-5ada03adca17","properties":{"fqdn":"txt2.ssaklecha.com.","TTL":300,"TXTRecords":[{"value":["\"Testing DNS Zone export\""]}],"targetResource":{},"provisioningState":"Succeeded"}}]} cli.azure.cli.core.azclierror: Traceback (most recent call last): File "/usr/lib64/az/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 663, in execute raise ex File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(*args, kwargs) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(**command_args) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/network/custom.py", line 2622, in export_zone if (record_type == 'a' or record_type == 'aaaa' or record_type == 'cname') and record_set["target_resource"]["id"]: KeyError: 'id'

Expected behavior

It output dns zone content as expected

Environment Summary

azure-cli 2.52.0

core 2.52.0 telemetry 1.1.0

Extensions: ai-examples 0.2.5 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/siddharth/.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.

diepes commented 9 months ago

Just ran into very similar bug with Mircrosoft az cli, trying to export zone. Updated az cli to latest version, still the same error.

az version { "azure-cli": "2.56.0", "azure-cli-core": "2.56.0", "azure-cli-telemetry": "1.1.0", "extensions": { "bastion": "0.3.0", "ml": "2.22.0" } }

` az network dns zone export -g --name "" -f -zone-20240124.txt Command group 'az network' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus The command failed with an unexpected error. Here is the traceback: 'id' Traceback (most recent call last): File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 663, in execute raise ex File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) ^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) ^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/command_modules/network/custom.py", line 2633, in export_zone if (record_type == 'a' or record_type == 'aaaa' or record_type == 'cname') and record_set["target_resource"]["id"]:


KeyError: 'id'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
`
Bv-Lucas commented 5 months ago

Hello, running into a similar issue too, any news on this issue ?

The command failed with an unexpected error. Here is the traceback:
'id'
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.59.0/libexec/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.59.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 664, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.59.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 731, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.59.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 701, in _run_job
    result = cmd_copy(params)
             ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.59.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 334, in __call__
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.59.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
           ^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.59.0/libexec/lib/python3.11/site-packages/azure/cli/command_modules/network/custom.py", line 2641, in export_zone
    if (record_type == 'a' or record_type == 'aaaa' or record_type == 'cname') and record_set["target_resource"]["id"]:
                                                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'id'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues