Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global parameter --output json not working for command az aks check-acr #27828

Open
mpowrie opened this issue Nov 13, 2023 · 2 comments
Open
Labels
AKS az aks/acs/openshift Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.

Comments

@mpowrie
Copy link

mpowrie commented Nov 13, 2023

Describe the bug

The documentation indicates that command az aks check-acr should have a global parameter --output that works. However this parameter does not change the output displayed from descriptive text.

Example:

az aks check-acr --name $ClusterName --resource-group $ClusterName --acr "$ContainerRegistryName.azurecr.io" --output json

Link to documentation:
https://learn.microsoft.com/en-us/cli/azure/aks?view=azure-cli-latest#az-aks-check-acr

Related command

az aks check-acr

Errors

no errors - but the output does not change.
Example (with sensitive info removed):

az aks check-acr --name mycluster --resource-group mycluster --acr myacr.azurecr.io --output tsv
Merged "mycluster" as current context in C:\Users\user\AppData\Local\Temp\tmpeo2q6v8h
[2023-11-13T11:07:46Z] Checking host name resolution (myacr.azurecr.io): SUCCEEDED
[2023-11-13T11:07:46Z] Canonical name for ACR (myacr.azurecr.io): r1000ause.australiasoutheast.cloudapp.azure.com.
[2023-11-13T11:07:46Z] ACR location: australiasoutheast
[2023-11-13T11:07:46Z] Checking managed identity...
[2023-11-13T11:07:46Z] Kubelet managed identity client ID: aaa
[2023-11-13T11:07:46Z] Validating managed identity existance: SUCCEEDED
[2023-11-13T11:07:47Z] Validating image pull permission: SUCCEEDED
[2023-11-13T11:07:47Z]
Your cluster can pull images from myacr.azurecr.io!

Issue script & Debug output

az aks check-acr --name mycluster --resource-group mycluster --acr myacr.azurecr.io --output json --debug
cli.knack.cli: Command arguments: ['aks', 'check-acr', '--name', 'mycluster', '--resource-group', 'mycluster', '--acr', 'myacr.azurecr.io', '--output', 'json', '--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 0x01BFB460>, <function OutputProducer.on_global_arguments at 0x01DFE6A0>, <function CLIQuery.on_global_arguments at 0x01E182F8>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'aks': ['azure.cli.command_modules.acs']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name                  Load Time    Groups  Commands
cli.azure.cli.core: acs                       0.049         7        54
cli.azure.cli.core: Total (1)                 0.049         7        54
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 7 groups, 54 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command  : aks check-acr
cli.azure.cli.core: Command table: aks check-acr
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x03FBC460>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\user\.azure\commands\2023-11-13.22-10-56.aks_check-acr.48172.log'.
az_command_data_logger: command args: aks check-acr --name {} --resource-group {} --acr {} --output {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x03FE7538>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x040CA460>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x040CA658>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x01DFE6E8>, <function CLIQuery.handle_query_parameter at 0x01E18340>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x040CA610>]
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ContainerServiceClient
cli.azure.cli.core.auth.persistence: build_persistence: location='C:\\Users\\user\\.azure\\msal_token_cache.bin', encrypt=True
cli.azure.cli.core.auth.binary_cache: load: C:\Users\user\.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/bbb/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/bbb/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/bbb/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/bbb/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/bbb/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/bbb/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/bbb/kerberos', 'tenant_region_scope': 'OC', '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: b4b9c4dc-acdb-41f1-ae6c-023daa57bf9b
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/aaa/resourceGroups/mycluster/providers/Microsoft.ContainerService/managedClusters/mycluster/listClusterUserCredential?api-version=2023-07-01'
cli.azure.cli.core.sdk.policies: Request method: 'POST'
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': 'ddd'
cli.azure.cli.core.sdk.policies:     'CommandName': 'aks check-acr'
cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--name --resource-group --acr --output --debug'
cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.53.1 (MSI) azsdk-python-azure-mgmt-containerservice/26.0.0 Python/3.10.10 (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 "POST /subscriptions/aaa/resourceGroups/mycluster/providers/Microsoft.ContainerService/managedClusters/mycluster/listClusterUserCredential?api-version=2023-07-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'
cli.azure.cli.core.sdk.policies:     'Content-Encoding': 'gzip'
cli.azure.cli.core.sdk.policies:     'Expires': '-1'
cli.azure.cli.core.sdk.policies:     'Vary': 'Accept-Encoding'
cli.azure.cli.core.sdk.policies:     'x-ms-routing-request-id': 'AUSTRALIASOUTHEAST:20231113T111057Z:ccc'
cli.azure.cli.core.sdk.policies:     'x-ms-ratelimit-remaining-subscription-writes': '1197'
cli.azure.cli.core.sdk.policies:     'x-ms-correlation-request-id': 'ccc'
cli.azure.cli.core.sdk.policies:     'x-ms-request-id': 'eee'
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, 13 Nov 2023 11:10:56 GMT'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {
  "kubeconfigs": [
   {
    "name": "clusterUser",
    "value": "xxxo="
   }
  ]
 }
cli.azure.cli.command_modules.acs.custom: Merged "mycluster" as current context in C:\Users\user\AppData\Local\Temp\tmpno217bgu


[2023-11-13T11:11:07Z] Checking host name resolution (myacr.azurecr.io): SUCCEEDED
[2023-11-13T11:11:07Z] Canonical name for ACR (myacr.azurecr.io): r1029ause.australiasoutheast.cloudapp.azure.com.
[2023-11-13T11:11:07Z] ACR location: australiasoutheast
[2023-11-13T11:11:07Z] Checking managed identity...
[2023-11-13T11:11:07Z] Kubelet managed identity client ID: fff
[2023-11-13T11:11:07Z] Validating managed identity existance: SUCCEEDED
[2023-11-13T11:11:08Z] Validating image pull permission: SUCCEEDED
[2023-11-13T11:11:08Z]
Your cluster can pull images from myacr.azurecr.io!


cli.knack.cli: Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x03FDFC40>, <function _x509_from_base64_to_hex_transform at 0x03FDFC88>]
cli.knack.cli: Event: CommandInvoker.OnFilterResult []
cli.knack.cli: Event: Cli.SuccessfulExecute []
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x03FBC580>]
az_command_data_logger: exit code: 0
cli.__main__: Command ran in 12.440 seconds (init: 0.344, invoke: 12.096)
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 3347 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\user\.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.

Expected behavior

the output should change according to the output parameter - e.g. --output json should output JSON format.

Environment Summary

azure-cli 2.53.1

core 2.53.1
telemetry 1.1.0

Extensions:
bastion 0.2.5

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

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\user.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

Additional context

No response

@mpowrie mpowrie added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Nov 13, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. AKS az aks/acs/openshift Service Attention This issue is responsible by Azure service team. Auto-Assign Auto assign by bot labels Nov 13, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Nov 13, 2023

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

Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @dyu1208, @FumingZhang, @andyliuliming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AKS az aks/acs/openshift Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

2 participants