Azure / azure-cli

Azure Command-Line Interface
MIT License
4.01k stars 2.98k forks source link

az network list-service-tags has an empty response with an empty nextlink #27349

Open Gamecock opened 1 year ago

Gamecock commented 1 year ago

Describe the bug

Using example command from cli docs in cloudshell. I get this response.

$ az network list-service-tags --location westus2 { "nextLink": "" }

Related command

$ az network list-service-tags

Errors

none - just empty response with empty nextlink

Issue script & Debug output

$ az network list-service-tags --location westus2 --debug cli.knack.cli: Command arguments: ['network', 'list-service-tags', '--location', 'westus2', '--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 0x01A3B538>, <function OutputProducer.on_global_arguments at 0x01C3D778>, <function CLIQuery.on_global_arguments at 0x01C583D0>]
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.706 115 453 cli.azure.cli.core: privatedns 0.070 14 60 cli.azure.cli.core: Total (2) 0.777 129 513 cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next'] cli.azure.cli.core: Loading extensions: cli.azure.cli.core: Name Load Time Groups Commands Directory cli.azure.cli.core: Total (0) 0.000 0 0
cli.azure.cli.core: Loaded 128 groups, 513 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : network list-service-tags cli.azure.cli.core: Command table: network list-service-tags cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x03DDB610>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\FinchMik.azure\commands\2023-09-08.14-05-05.network_list-service-tags.18936.log'. az_command_data_logger: command args: network list-service-tags --location {} --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x03E05778>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x03E156E8>, <function register_cache_arguments..add_cache_arguments at 0x03E158E0>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x01C3D7C0>, <function CLIQuery.handle_query_parameter at 0x01C58418>, <function register_ids_argument..parse_ids_arguments at 0x03E15898>] cli.azure.cli.core.auth.persistence: build_persistence: location='C:\Users\FinchMik\.azure\msal_token_cache.bin', encrypt=True cli.azure.cli.core.auth.binary_cache: load: C:\Users\FinchMik.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/37051258-66ca-457a-a41d-d94c41705e37/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/37051258-66ca-457a-a41d-d94c41705e37/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/37051258-66ca-457a-a41d-d94c41705e37/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/37051258-66ca-457a-a41d-d94c41705e37/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/37051258-66ca-457a-a41d-d94c41705e37/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/37051258-66ca-457a-a41d-d94c41705e37/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/37051258-66ca-457a-a41d-d94c41705e37/kerberos', 'tenant_region_scope': 'NA', '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: Found 1 RTs matching {'environment': 'login.microsoftonline.com', 'home_account_id': '****.37051258-66ca-457a-a41d-d94c41705e37', 'family_id': '1'} msal.telemetry: Generate or reuse correlation_id: aecf122c-b56d-4f79-9156-e4fa7025bad8 msal.application: Cache attempts an RT urllib3.connectionpool: Starting new HTTPS connection (1): login.microsoftonline.com:443 urllib3.connectionpool: https://login.microsoftonline.com:443 "POST /37051258-66ca-457a-a41d-d94c41705e37/oauth2/v2.0/token HTTP/1.1" 200 4426 msal.token_cache: event={ "client_id": "04b07795-8ddb-461a-bbee-02f9e1bf7b46", "data": { "claims": "{\"access_token\": {\"xms_cc\": {\"values\": [\"CP1\"]}}}", "refresh_token": "****", "scope": [ "openid", "offline_access", "profile", "https://management.core.windows.net//.default" ] }, "environment": "login.microsoftonline.com", "grant_type": "refresh_token", "params": null, "response": { "access_token": "****", "client_info": "eyJ1aWQiOiI3ZDFiNGVjYy0wMGMxLTQyYjgtYWJiYi1hY2FkMzJhNTZlOGQiLCJ1dGlkIjoiMzcwNTEyNTgtNjZjYS00NTdhLWE0MWQtZDk0YzQxNzA1ZTM3In0", "expires_in": 5082, "ext_expires_in": 5082, "foci": "1", "id_token": "****", "scope": "https://management.core.windows.net//user_impersonation https://management.core.windows.net//.default", "token_type": "Bearer" }, "scope": [ "https://management.core.windows.net//user_impersonation", "https://management.core.windows.net//.default" ], "skip_account_creation": true, "token_endpoint": "https://login.microsoftonline.com/37051258-66ca-457a-a41d-d94c41705e37/oauth2/v2.0/token" } cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/0a3f6ddf-b9ad-46a1-b74a-3e3fe912163e/providers/Microsoft.Network/locations/westus2/serviceTags?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': '3c87aaa3-4e72-11ee-a675-3887d52cdc4b' cli.azure.cli.core.sdk.policies: 'CommandName': 'network list-service-tags' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--location --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.52.0 (MSI) (AAZ) azsdk-python-core/1.26.0 Python/3.10.10 (Windows-10-10.0.19045-SP0)' 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/0a3f6ddf-b9ad-46a1-b74a-3e3fe912163e/providers/Microsoft.Network/locations/westus2/serviceTags?api-version=2022-01-01 HTTP/1.1" 200 26 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: 'Content-Length': '26' cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8' cli.azure.cli.core.sdk.policies: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '929b1f12-4982-4326-8f8b-19f89970ff6a' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '929b1f12-4982-4326-8f8b-19f89970ff6a' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'EASTUS2:20230908T180507Z:929b1f12-4982-4326-8f8b-19f89970ff6a' 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: 'X-Cache': 'CONFIG_NOCACHE' cli.azure.cli.core.sdk.policies: 'X-MSEdge-Ref': 'Ref A: 17C2351563B2428AA3AD844C1C5DA58E Ref B: BN1AA2051012049 Ref C: 2023-09-08T18:05:06Z' cli.azure.cli.core.sdk.policies: 'Date': 'Fri, 08 Sep 2023 18:05:06 GMT' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"value":[],"nextLink":""} cli.knack.cli: Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x03E04E38>, <function _x509_from_base64_to_hex_transform at 0x03E04E80>] cli.knack.cli: Event: CommandInvoker.OnFilterResult [] { "nextLink": "" } cli.knack.cli: Event: Cli.SuccessfulExecute [] cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x03DDB730>] az_command_data_logger: exit code: 0 cli.main: Command ran in 3.259 seconds (init: 0.437, invoke: 2.823) 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 3277 in cache telemetry.main: Begin creating telemetry upload process. telemetry.process: Creating upload process: "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\telemetry__init__.pyc C:\Users\FinchMik.azure"
telemetry.process: Return from creating process telemetry.main: Finish creating telemetry upload process.

Expected behavior

A list of endpoints similar to json object here

Environment Summary

CLOUDSHELL: az --version 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/mike_finch/.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

DESKTOP: $ az --version azure-cli 2.52.0

core 2.52.0 telemetry 1.1.0

Extensions: azure-iot 0.21.5

Dependencies: msal 1.24.0b1 azure-mgmt-resource 23.1.0b2

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe' Extensions directory 'C:\Users\FinchMik.azure\cliextensions'

Python (Windows) 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:05:00) [MSC v.1929 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

Unable to check if your CLI is up-to-date. Check your internet connection.

Additional context

No response

yonzhan commented 1 year ago

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

microsoft-github-policy-service[bot] commented 1 year ago

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

microsoft-github-policy-service[bot] commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-iot-cli-triage.

r300mrg commented 5 months ago

This still seems to be an issue. Is there any update? Thanks

image

r300mrg commented 5 months ago

This still seems to be an issue. Is there any update? Thanks

image

I found the cause of this issue on my side.

The Subscription ID that the Cloud Shell was using was not a Subscription ID I have access to and not my default assigned Subscription ID.

Either of the two helped resolve/workaround the "nextLink": "" result.

az account set --subscription az network list-service-tags --location westus2 --subscription