azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

`az aks create --debug/--verbose` not showing debug logs

Open mohoff opened this issue 6 years ago • 4 comments

The flags --debug and --verbose do not provide additional log output when running the command

az aks create \
		--name $(NAME) \
		--resource-group $(RESOURCE_GROUP) \
		--location $(LOCATION) \
		--service-principal $(SERVICE_PRINCIPAL_ID) \
		--client-secret $(SERVICE_PRINCIPAL_PASSWORD) \
		--attach-acr $(ACR_ID) \
		--enable-cluster-autoscaler \
		--min-count $(AKS_AUTOSCALER_MIN_NODES) \
		--max-count $(AKS_AUTOSCALER_MAX_NODES) \
		--enable-addons monitoring \
		--workspace-resource-id $(LOG_ANALYTICS_WORKSPACE_ID) \
		--kubernetes-version $(AKS_KUBERNETES_VERSION) \
		--debug # or --verbose

The output is for me:

Use existing SSH public key file: /Users/mo/.ssh/id_rsa.pub
Waiting for AAD role to propagate
AAD role propagation done[############################################]  100.0000%AAD role propagation done
Operation failed with status: 'Bad Request'. Details: The credentials in ServicePrincipalProfile were invalid. Please see https://aka.ms/aks-sp-help for more details. (Details: adal: Refresh request failed. Status Code = '401'. Response body: {"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret is provided.\r\nTrace ID: ...\r\nCorrelation ID: ...\r\nTimestamp: 2020-04-15 10:40:05Z","error_codes":[7000215],"timestamp":"2020-04-15 10:40:05Z","trace_id":"...","correlation_id":"...","error_uri":"https://login.microsoftonline.com/error?code=7000215"})

This prevents me from tracking down an issue related to invalid --client-secret passed.

The debug output works nicely for commands like az ad sp create-for-rbac.

mohoff avatar Apr 15 '20 10:04 mohoff

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/aks-pm.

ghost avatar Apr 15 '20 23:04 ghost

thanks for reporting, routing to appropriate team

yungezz avatar Apr 15 '20 23:04 yungezz

just tried and it seems to be working now, I would say this can be closed

✖ az aks create --name test-13025 --resource-group interview --location eastus --enable-cluster-autoscaler --min-count 1 --max-count 5 --kubernetes-version 1.15.10 --debug --verbose
Command arguments: ['aks', 'create', '--name', 'test-13025', '--resource-group', 'interview', '--location', 'eastus', '--enable-cluster-autoscaler', '--min-count', '1', '--max-count', '5', '--kubernetes-version', '1.15.10', '--debug', '--verbose']
Event: Cli.PreExecute []
Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x1014c6c10>, <function OutputProducer.on_global_arguments at 0x101530ca0>, <function CLIQuery.on_global_arguments at 0x101555430>]
Event: CommandInvoker.OnPreCommandTableCreate []
Installed command modules ['acr', 'acs', 'advisor', 'ams', 'apim', 'appconfig', 'appservice', 'aro', 'backup', 'batch', 'batchai', 'billing', 'botservice', 'cdn', 'cloud', 'cognitiveservices', 'configure', 'consumption', 'container', 'cosmosdb', 'deploymentmanager', 'dla', 'dls', 'dms', 'eventgrid', 'eventhubs', 'extension', 'feedback', 'find', 'hdinsight', 'interactive', 'iot', 'iotcentral', 'keyvault', 'kusto', 'lab', 'managedservices', 'maps', 'monitor', 'natgateway', 'netappfiles', 'network', 'policyinsights', 'privatedns', 'profile', 'rdbms', 'redis', 'relay', 'reservations', 'resource', 'role', 'search', 'security', 'servicebus', 'servicefabric', 'signalr', 'sql', 'sqlvm', 'storage', 'vm']
Loaded module 'acr' in 0.006 seconds.
Loaded module 'acs' in 0.006 seconds.
....
vent: CommandLoader.OnLoadCommandTable []
Loaded module 'storage' in 0.032 seconds.
Loaded module 'vm' in 0.014 seconds.
Loaded all modules in 0.299 seconds. (note: there's always an overhead with the first module loaded)
Found 1 extensions: ['aks-preview']
Extension compatibility result: is_compatible=True cli_core_version=2.6.0 min_required=2.0.49 max_required=None
Extensions directory: '/Users/sylvain_boily/.azure/cliextensions/aks-preview'
Event: CommandLoader.OnLoadCommandTable []
Loaded extension 'aks-preview' in 0.004 seconds.
Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x102358280>]
az_command_data_logger : command args: aks create --name {} --resource-group {} --location {} --enable-cluster-autoscaler --min-count {} --max-count {} --kubernetes-version {} --debug --verbose
metadata file logging enabled - writing logs to '/Users/sylvain_boily/.azure/commands'.
Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x102376790>]
Event: CommandLoader.OnLoadArguments []
Event: CommandInvoker.OnPostArgumentLoad []
Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x1023a8f70>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x1023cd160>]
Event: CommandInvoker.OnCommandTableLoaded []
Event: CommandInvoker.OnPreParseArgs [<function _documentdb_deprecate at 0x102a9f670>]
Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x101530d30>, <function CLIQuery.handle_query_parameter at 0x1015554c0>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x1023cd040>, <function handler at 0x102bfa310>]
az_command_data_logger : extension name: aks-preview
az_command_data_logger : extension version: 0.4.50
The behavior of this command has been altered by the following extension: aks-preview
Use existing SSH public key file: /Users/<me>/.ssh/id_rsa.pub
Getting management service client client_type=ContainerServiceClient
msrest.universal_http.requests : Configuring retry: max_retries=4, backoff_factor=0.8, max
....
azure-cli                          2.6.0

command-modules-nspkg              2.0.3
core                               2.6.0
nspkg                              3.0.4
telemetry                          1.0.4

Extensions:
aks-preview                       0.4.50

Python location '/usr/local/Cellar/azure-cli/2.6.0/libexec/bin/python'
Extensions directory '/Users/sylvain_boily/.azure/cliextensions'

Python (Darwin) 3.8.2 (default, Mar 11 2020, 00:29:50) 
[Clang 11.0.0 (clang-1100.0.33.17)]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

djsly avatar May 30 '20 04:05 djsly

Looks like this issue has been fixed, so closing this issue!

Jen7714 avatar May 30 '20 21:05 Jen7714