Azure / azure-cli

Azure Command-Line Interface
MIT License
3.97k stars 2.95k forks source link

az afd profile show returns "/resourcegroups/" #28412

Open baoj-dfo opened 7 months ago

baoj-dfo commented 7 months ago

Describe the bug

az afd profile show returns /subscriptions//resourcegroups//providers/Microsoft.Cdn/profiles/ while should returns /subscriptions//resourceGroups//providers/Microsoft.Cdn/profiles/

Related command

az afd profile show -g group --profile-name profile https://learn.microsoft.com/en-us/cli/azure/afd/profile?view=azure-cli-latest#az-afd-profile-show

Errors

ID returns /subscriptions//resourcegroups//providers/Microsoft.Cdn/profiles/***

the /resourcegroups/ suppose to be /resourceGroups/

Issue script & Debug output

cli.knack.cli: Command arguments: ['afd', 'profile', 'show', '-n', '', '-g', '', '--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 0x0000021C33D0B880>, <function OutputProducer.on_global_arguments at 0x0000021C33E96020>, <function CLIQuery.on_global_arguments at 0x0000021C33EC3BA0>] cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] cli.azure.cli.core: Modules found from index for 'afd': ['azure.cli.command_modules.cdn'] cli.azure.cli.core: Loading command modules: cli.azure.cli.core: Name Load Time Groups Commands cli.azure.cli.core: cdn 0.259 35 99 cli.azure.cli.core: Total (1) 0.259 35 99 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 35 groups, 99 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : afd profile show cli.azure.cli.core: Command table: afd profile show cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x0000021C36D8AA20>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users**.azure\commands\2024-02-20.09-07-37.afd_profile_show.45888.log'. az_command_data_logger: command args: afd profile show -n {} -g {} --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x0000021C36DED080>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x0000021C36DED120>, <function register_cache_arguments..add_cache_arguments at 0x0000021C36DED260>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x0000021C33E960C0>, <function CLIQuery.handle_query_parameter at 0x0000021C33EC3C40>, <function register_ids_argument..parse_ids_arguments at 0x0000021C36DED1C0>] Command group 'afd' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus cli.azure.cli.core.auth.persistence: build_persistence: location='C:\Users\\.azure\msal_token_cache.bin', encrypt=True cli.azure.cli.core.auth.binary_cache: load: C:\Users**.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/1594fdae-a1d9-4405-915d-011467234338/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/1594fdae-a1d9-4405-915d-011467234338/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/1594fdae-a1d9-4405-915d-011467234338/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/1594fdae-a1d9-4405-915d-011467234338/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/1594fdae-a1d9-4405-915d-011467234338/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/1594fdae-a1d9-4405-915d-011467234338/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/1594fdae-a1d9-4405-915d-011467234338/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? True 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: 2ac3b034-bf6d-4290-b822-9f1510ac27cc cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/****/resourceGroups/****/providers/Microsoft.Cdn/profiles/****?api-version=2023-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': '8bea3d0b-d012-11ee-af88-cc96e574e7ca' cli.azure.cli.core.sdk.policies: 'CommandName': 'afd profile show' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '-n -g --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.57.0 (MSI) (AAZ) azsdk-python-core/1.28.0 Python/3.11.7 (Windows-10-10.0.22621-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//resourceGroups//providers/Microsoft.Cdn/profiles/?api-version=2023-05-01 HTTP/1.1" 200 530 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': '530' 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: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '8cb487dd-c2ba-4cb1-8e7c-151e7390a47b' cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '8bea3d0b-d012-11ee-af88-cc96e574e7ca' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-resource-requests': '499' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': 'ad485940-8914-4fd6-92de-fdeec3fdfdf2' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'CANADAEAST:20240220T170737Z:ad485940-8914-4fd6-92de-fdeec3fdfdf2' 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: D8EC0849269C44988B91C8EDA19FE794 Ref B: CO6AA3150220027 Ref C: 2024-02-20T17:07:37Z' cli.azure.cli.core.sdk.policies: 'Date': 'Tue, 20 Feb 2024 17:07:36 GMT' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"id":"/subscriptions//resourcegroups//providers/Microsoft.Cdn/profiles/","type":"Microsoft.Cdn/profiles","name":"","location":"Global","kind":"frontdoor","tags":{"group":"CDOS","project":"APS","sap-fc":"270014-ISS0701-B120-65150015"},"sku":{"name":"Standard_AzureFrontDoor"},"properties":{"originResponseTimeoutSeconds":60,"frontDoorId":"140d8610-0982-4a7b-bbd7-4c4b3bfb4666","extendedProperties":{},"resourceState":"Active","provisioningState":"Succeeded"}} cli.knack.cli: Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x0000021C36DCA0C0>, <function _x509_from_base64_to_hex_transform at 0x0000021C36DCA160>] cli.knack.cli: Event: CommandInvoker.OnFilterResult [] { "extendedProperties": {}, "frontDoorId": "140d8610-0982-4a7b-bbd7-4c4b3bfb4666", "id": "/subscriptions//resourcegroups//providers/Microsoft.Cdn/profiles/", "kind": "frontdoor", "location": "Global", "name": "", "originResponseTimeoutSeconds": 60, "provisioningState": "Succeeded", "resourceGroup": "", "resourceState": "Active", "sku": { "name": "Standard_AzureFrontDoor" }, "type": "Microsoft.Cdn/profiles" } cli.knack.cli: Event: Cli.SuccessfulExecute [] cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x0000021C36D8ACA0>] az_command_data_logger: exit code: 0 cli.main: Command ran in 1.390 seconds (init: 0.418, invoke: 0.972) cli.azure.cli.core.decorators: Suppress exception: Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/main.py", line 62, in File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/main.py", line 55, in SystemExit: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/decorators.py", line 79, in _wrapped_func File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/telemetry.py", line 532, in _get_secrets_warning_config File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/config.py", line 147, in getboolean ValueError: Not a boolean: None

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 3332 in cache telemetry.main: Begin creating telemetry upload process. telemetry.process: Creating upload process: "C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\telemetry__init__.pyc C:\Users****.azure" telemetry.process: Return from creating process telemetry.main: Finish creating telemetry upload process.

Expected behavior

should returns /subscriptions//resourceGroups//providers/Microsoft.Cdn/profiles/***

Environment Summary

azure-cli 2.57.0

core 2.57.0 telemetry 1.1.0

Additional context

No response

yonzhan commented 7 months ago

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

microsoft-github-policy-service[bot] commented 7 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @cdnfdsuppgithub, @t-bzhan, @gxue, @TracyYaoYao.

Ptnan7 commented 2 months ago

As I reproduced, our service returns a non-capital response content, it may be stored with lower case. And our ARM specification is case insensitive, so it will not trigger other issue.