Azure / Azure/azure-cli

az network dns zone list fails (subscription not found) for a known good subscription

Open
#27,766 4 comments 0 reactions 0 assignees View on GitHub
act-platform-engineering-squad act-quality-productivity-squad Auto-Assign Auto-Resolve Azure CLI Team customer-reported Network - DNS question Service Attention Upgrade
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

az network dns zone list fails. I am unable to create these zones in the web portal either (they create, then when browsing to the resource they 404)

interestingly, the following command does not fail:

az network private-dns zone list
[]
and the web portal allows me to create private dns zones without problem.

### Related command

az network dns zone list

### Errors

az network dns zone list
(BadRequest) The specified subscription 22b20269-XXXX-4118-a306-77649e5c75e4 does not exist
Code: BadRequest
Message: The specified subscription 22b20269-XXXX-4118-a306-77649e5c75e4 does not exist

az network private-dns zone list
[]

### Issue script & Debug output

``az network dns zone list --debug
cli.knack.cli: Command arguments: ['network', 'dns', 'zone', 'list', '--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']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: network 0.570 112 348
cli.azure.cli.core: privatedns 0.005 14 66
cli.azure.cli.core: Total (2) 0.575 126 414
cli.azure.cli.core: Loaded 125 groups, 414 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : network dns zone list
cli.azure.cli.core: Command table: network dns zone list
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate []
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [.add_subscription_parameter at 0x7fe9eed13520>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [.add_ids_arguments at 0x7fe9eed61480>, .add_cache_arguments at 0x7fe9eed615a0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [, , .parse_ids_arguments at 0x7fe9eed61510>]
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=DnsManagementClient
cli.azure.cli.core.auth.persistence: build_persistence: location='/home/craig/.azure/msal_token_cache.json', encrypt=False
cli.azure.cli.core.auth.binary_cache: load: /home/craig/.azure/msal_http_cache.bin
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/0a523852-1ccb-4ba9-9854-8f6598597ff5/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/0a523852-1ccb-4ba9-9854-8f6598597ff5/discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': 'https://login.microsoftonline.com/0a523852-1ccb-4ba9-9854-8f6598597ff5/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/0a523852-1ccb-4ba9-9854-8f6598597ff5/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/0a523852-1ccb-4ba9-9854-8f6598597ff5/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/0a523852-1ccb-4ba9-9854-8f6598597ff5/oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com/0a523852-1ccb-4ba9-9854-8f6598597ff5/kerberos', 'tenant_region_scope': 'EU', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'}
msal.application: Broker enabled? False
cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://management.core.windows.net//.default',), claims=None, kwargs={}
msal.application: Cache hit an AT
msal.telemetry: Generate or reuse correlation_id: 8ba63f42-4ab8-4f53-909c-37e6abe2ec9f
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/22b20269-ce3e-4118-a306-77649e5c75e4/providers/Microsoft.Network/dnszones?api-version=2018-05-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': '28bb9057-7b65-11ee-a7ab-9cb6d0c77287'
cli.azure.cli.core.sdk.policies: 'CommandName': 'network dns zone list'
cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--debug'
cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.47.0 (DEB) azsdk-python-azure-mgmt-dns/8.0.0 Python/3.10.10 (Linux-6.5.0-10-generic-x86_64-with-glibc2.38)'
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/22b20269-ce3e-4118-a306-77649e5c75e4/providers/Microsoft.Network/dnszones?api-version=2018-05-01 HTTP/1.1" 400 112
cli.azure.cli.core.sdk.policies: Response status: 400
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies: 'Cache-Control': 'private'
cli.azure.cli.core.sdk.policies: 'Content-Length': '112'
cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8'
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': '28bb9057-7b65-11ee-a7ab-9cb6d0c77287'
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': '60000'
cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': 'df12c5dd-7b42-4a8c-abd2-f07e1dde46ab'
cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'FRANCESOUTH:20231104T225451Z:df12c5dd-7b42-4a8c-abd2-f07e1dde46ab'
cli.azure.cli.core.sdk.policies: 'Date': 'Sat, 04 Nov 2023 22:54:50 GMT'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"code":"BadRequest","message":"The specified subscription 22b20269-ce3e-4118-a306-77649e5c75e4 does not exist"}
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/opt/az/lib/python3.10/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/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 710, in _run_job
result = list(result)
File "/opt/az/lib/python3.10/site-packages/azure/core/paging.py", line 129, in __next__
return next(self._page_iterator)
File "/opt/az/lib/python3.10/site-packages/azure/core/paging.py", line 76, in __next__
self._response = self._get_next(self.continuation_token)
File "/opt/az/lib/python3.10/site-packages/azure/mgmt/dns/v2018_05_01/operations/_zones_operations.py", line 527, in get_next
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
azure.core.exceptions.HttpResponseError: (BadRequest) The specified subscription 22b20269-ce3e-4118-a306-77649e5c75e4 does not exist
Code: BadRequest
Message: The specified subscription 22b20269-ce3e-4118-a306-77649e5c75e4 does not exist

cli.azure.cli.core.azclierror: (BadRequest) The specified subscription 22b20269-ce3e-4118-a306-77649e5c75e4 does not exist
Code: BadRequest
Message: The specified subscription 22b20269-ce3e-4118-a306-77649e5c75e4 does not exist
az_command_data_logger: (BadRequest) The specified subscription 22b20269-ce3e-4118-a306-77649e5c75e4 does not exist
Code: BadRequest
Message: The specified subscription 22b20269-ce3e-4118-a306-77649e5c75e4 does not exist
cli.knack.cli: Event: Cli.PostExecute []
cli.__main__: Command ran in 1.461 seconds (init: 0.195, invoke: 1.266)
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 3673 in cache
telemetry.check: Returns Positive.
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/usr/bin/../../opt/az/bin/python3 /opt/az/lib/python3.10/site-packages/azure/cli/telemetry/__init__.py /home/craig/.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.

### Expected behavior

Expecting an empty array

### Environment Summary

azure-cli 2.47.0 *

core 2.47.0 *
telemetry 1.0.8 *

Dependencies:
msal 1.20.0
azure-mgmt-resource 22.0.0

Python location '/opt/az/bin/python3'
Extensions directory '/home/craig/.azure/cliextensions'

Python (Linux) 3.10.10 (main, Mar 31 2023, 09:26:59) [GCC 11.3.0]

Legal docs and information: aka.ms/AzureCliLegal

You have 3 update(s) available. Consider updating your CLI installation with 'az upgrade'

### Additional context

x

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.