I'm using Azure DevOps pipelines to run an AzureCLI@2, which performs az acr login -n <repo-name>. It is using a Azure ARM service connection with workload identity federation with openid connect. The task successfully logs in to azure just fine. When the acr login command is executed, I get an error.
Related command
az acr login -n
Errors
WARNING: Unable to get AAD authorization tokens with message: 2024-04-13 00:15:05.762436 An error occurred: CONNECTIVITY_REFRESH_TOKEN_ERROR
Access to registry '.azurecr.io' was denied. Response code: 401. Please try running 'az login' again to refresh permissions.
WARNING: Unable to get admin user credentials with message: The resource with name '' and type 'Microsoft.ContainerRegistry/registries' could not be found in subscription ')'.
ERROR: Unable to authenticate using AAD or admin login credentials. Please specify both username and password in non-interactive mode.
Issue script & Debug output
2024-04-13T00:29:22.1811183Z DEBUG: cli.knack.cli: Command arguments: ['acr', 'login', '--name', '<redacted>', '--debug']
2024-04-13T00:29:22.1811494Z DEBUG: cli.knack.cli: __init__ debug log:
2024-04-13T00:29:22.1811655Z Cannot enable color.
2024-04-13T00:29:22.1811901Z DEBUG: cli.knack.cli: Event: Cli.PreExecute []
2024-04-13T00:29:22.1812274Z DEBUG: cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f5525e140e0>, <function OutputProducer.on_global_arguments at 0x7f5525dbe200>, <function CLIQuery.on_global_arguments at 0x7f5525df7ce0>]
2024-04-13T00:29:22.1825505Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
2024-04-13T00:29:22.1831382Z DEBUG: cli.azure.cli.core: Modules found from index for 'acr': ['azure.cli.command_modules.acr']
2024-04-13T00:29:22.1831935Z DEBUG: cli.azure.cli.core: Loading command modules:
2024-04-13T00:29:22.1832614Z DEBUG: cli.azure.cli.core: Name Load Time Groups Commands
2024-04-13T00:29:22.2893694Z DEBUG: cli.azure.cli.core: acr 0.106 36 149
2024-04-13T00:29:22.2894466Z DEBUG: cli.azure.cli.core: Total (1) 0.106 36 149
2024-04-13T00:29:22.2900187Z DEBUG: cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
2024-04-13T00:29:22.2900649Z DEBUG: cli.azure.cli.core: Loading extensions:
2024-04-13T00:29:22.2901071Z DEBUG: cli.azure.cli.core: Name Load Time Groups Commands Directory
2024-04-13T00:29:22.2901612Z DEBUG: cli.azure.cli.core: Total (0) 0.000 0 0
2024-04-13T00:29:22.2904014Z DEBUG: cli.azure.cli.core: Loaded 36 groups, 149 commands.
2024-04-13T00:29:22.2904438Z DEBUG: cli.azure.cli.core: Found a match in the command table.
2024-04-13T00:29:22.2906960Z DEBUG: cli.azure.cli.core: Raw command : acr login
2024-04-13T00:29:22.2907313Z DEBUG: cli.azure.cli.core: Command table: acr login
2024-04-13T00:29:22.2908976Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f5524f1dd00>]
2024-04-13T00:29:22.2909695Z DEBUG: cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/vsts/work/_temp/.azclitask/commands/2024-04-13.00-29-22.acr_login.1705.log'.
2024-04-13T00:29:22.2917083Z INFO: az_command_data_logger: command args: acr login --name {} --debug
2024-04-13T00:29:22.2917656Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x7f5524d0ade0>]
2024-04-13T00:29:22.4088995Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
2024-04-13T00:29:22.4089955Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x7f5524d2e020>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x7f5524d2e160>]
2024-04-13T00:29:22.4098490Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
2024-04-13T00:29:22.4099004Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
2024-04-13T00:29:22.4102846Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f5525dbe2a0>, <function CLIQuery.handle_query_parameter at 0x7f5525df7d80>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x7f5524d2e0c0>]
2024-04-13T00:29:22.5479615Z DEBUG: cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ResourceManagementClient
2024-04-13T00:29:22.5571401Z DEBUG: cli.azure.cli.core.auth.persistence: build_persistence: location='/home/vsts/work/_temp/.azclitask/service_principal_entries.json', encrypt=False
2024-04-13T00:29:22.5572804Z DEBUG: cli.azure.cli.core.auth.persistence: build_persistence: location='/home/vsts/work/_temp/.azclitask/msal_token_cache.json', encrypt=False
2024-04-13T00:29:22.5576853Z DEBUG: cli.azure.cli.core.auth.binary_cache: load: /home/vsts/work/_temp/.azclitask/msal_http_cache.bin
2024-04-13T00:29:22.5577548Z DEBUG: urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
2024-04-13T00:29:22.5585938Z DEBUG: msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/<redacted>/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/<redacted>/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/<redacted>/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/<redacted>/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/<redacted>/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/<redacted>/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/<redacted>/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'}
2024-04-13T00:29:22.5588370Z DEBUG: msal.application: Broker enabled? None
2024-04-13T00:29:22.5773272Z DEBUG: cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
2024-04-13T00:29:22.5774402Z DEBUG: cli.azure.cli.core.auth.msal_authentication: ServicePrincipalCredential.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
2024-04-13T00:29:22.5775230Z DEBUG: msal.telemetry: Generate or reuse correlation_id: be26c6e8-ae79-49e3-9861-97d5e01a45a9
2024-04-13T00:29:22.5796757Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): login.microsoftonline.com:443
2024-04-13T00:29:22.6974737Z DEBUG: urllib3.connectionpool: https://login.microsoftonline.com:443 "POST /<redacted>/oauth2/v2.0/token HTTP/1.1" 200 1500
2024-04-13T00:29:22.6983348Z DEBUG: msal.token_cache: event={
2024-04-13T00:29:22.6984228Z "client_id": "***",
2024-04-13T00:29:22.6985147Z "data": {
2024-04-13T00:29:22.6985435Z "claims": "{\"access_token\": {\"xms_cc\": {\"values\": [\"CP1\"]}}}",
2024-04-13T00:29:22.6985632Z "scope": [
2024-04-13T00:29:22.6985879Z "https://management.core.windows.net//.default"
2024-04-13T00:29:22.6986069Z ]
2024-04-13T00:29:22.6986210Z },
2024-04-13T00:29:22.6986372Z "environment": "login.microsoftonline.com",
2024-04-13T00:29:22.6986601Z "grant_type": "client_credentials",
2024-04-13T00:29:22.6986782Z "params": null,
2024-04-13T00:29:22.6986941Z "response": {
2024-04-13T00:29:22.6987376Z "access_token": "********",
2024-04-13T00:29:22.6987553Z "expires_in": 3599,
2024-04-13T00:29:22.6987727Z "ext_expires_in": 3599,
2024-04-13T00:29:22.6987930Z "token_type": "Bearer"
2024-04-13T00:29:22.6988083Z },
2024-04-13T00:29:22.6988229Z "scope": [
2024-04-13T00:29:22.6988403Z "https://management.core.windows.net//.default"
2024-04-13T00:29:22.6988585Z ],
2024-04-13T00:29:22.6989105Z "token_endpoint": "https://login.microsoftonline.com/<redacted>/oauth2/v2.0/token"
2024-04-13T00:29:22.6989333Z }
2024-04-13T00:29:22.7012645Z DEBUG: cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/<redacted>/resources?$filter=resourceType%20eq%20%27Microsoft.ContainerRegistry%2Fregistries%27&api-version=2022-09-01'
2024-04-13T00:29:22.7013417Z DEBUG: cli.azure.cli.core.sdk.policies: Request method: 'GET'
2024-04-13T00:29:22.7013725Z DEBUG: cli.azure.cli.core.sdk.policies: Request headers:
2024-04-13T00:29:22.7014076Z DEBUG: cli.azure.cli.core.sdk.policies: 'Accept': 'application/json'
2024-04-13T00:29:22.7014521Z DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': 'dfa3c9cf-f92c-11ee-a987-d3ac0370acb8'
2024-04-13T00:29:22.7014916Z DEBUG: cli.azure.cli.core.sdk.policies: 'CommandName': 'acr login'
2024-04-13T00:29:22.7015280Z DEBUG: cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--name --debug'
2024-04-13T00:29:22.7015965Z DEBUG: cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.59.0 (DEB) azsdk-python-core/1.28.0 Python/3.11.8 (Linux-6.5.0-1017-azure-x86_64-with-glibc2.35) VSTS_afc33be0-a12e-4fd7-986e-ceadda2e1b93_build_896_0'
2024-04-13T00:29:22.7016463Z DEBUG: cli.azure.cli.core.sdk.policies: 'Authorization': '*****'
2024-04-13T00:29:22.7016715Z DEBUG: cli.azure.cli.core.sdk.policies: Request body:
2024-04-13T00:29:22.7016948Z DEBUG: cli.azure.cli.core.sdk.policies: This request has no body
2024-04-13T00:29:22.7051387Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
2024-04-13T00:29:22.8061514Z DEBUG: urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/<redacted>/resources?$filter=resourceType%20eq%20%27Microsoft.ContainerRegistry%2Fregistries%27&api-version=2022-09-01 HTTP/1.1" 200 12
2024-04-13T00:29:22.8070144Z DEBUG: cli.azure.cli.core.sdk.policies: Response status: 200
2024-04-13T00:29:22.8070689Z DEBUG: cli.azure.cli.core.sdk.policies: Response headers:
2024-04-13T00:29:22.8071971Z DEBUG: cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache'
2024-04-13T00:29:22.8072519Z DEBUG: cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache'
2024-04-13T00:29:22.8072998Z DEBUG: cli.azure.cli.core.sdk.policies: 'Content-Length': '12'
2024-04-13T00:29:22.8073588Z DEBUG: cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8'
2024-04-13T00:29:22.8074286Z DEBUG: cli.azure.cli.core.sdk.policies: 'Expires': '-1'
2024-04-13T00:29:22.8077911Z DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '9efda154-d798-494d-9a1e-241314e7b053'
2024-04-13T00:29:22.8078536Z DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '9efda154-d798-494d-9a1e-241314e7b053'
2024-04-13T00:29:22.8081362Z DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'CENTRALUS:20240413T002922Z:9efda154-d798-494d-9a1e-241314e7b053'
2024-04-13T00:29:22.8082080Z DEBUG: cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
2024-04-13T00:29:22.8082660Z DEBUG: cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff'
2024-04-13T00:29:22.8083159Z DEBUG: cli.azure.cli.core.sdk.policies: 'X-Cache': 'CONFIG_NOCACHE'
2024-04-13T00:29:22.8083842Z DEBUG: cli.azure.cli.core.sdk.policies: 'X-MSEdge-Ref': 'Ref A: 3CAEAD68EF4C42428E92D46FEA2F12D8 Ref B: DM2AA1091214045 Ref C: 2024-04-13T00:29:22Z'
2024-04-13T00:29:22.8110945Z DEBUG: cli.azure.cli.core.sdk.policies: 'Date': 'Sat, 13 Apr 2024 00:29:22 GMT'
2024-04-13T00:29:22.8111541Z DEBUG: cli.azure.cli.core.sdk.policies: Response content:
2024-04-13T00:29:22.8112185Z DEBUG: cli.azure.cli.core.sdk.policies: {"value":[]}
2024-04-13T00:29:22.8113058Z DEBUG: cli.azure.cli.command_modules.acr._docker_utils: Could not get registry from service. Exception: The resource with name '<redacted>' and type 'Microsoft.ContainerRegistry/registries' could not be found in subscription '<redacted>)'.
2024-04-13T00:29:22.8113917Z DEBUG: cli.azure.cli.command_modules.acr._docker_utils: 2024-04-13 00:29:22.808401 Sending a HTTP Get request to https://<redacted>.azurecr.io/v2/
2024-04-13T00:29:22.8114246Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): <redacted>.azurecr.io:443
2024-04-13T00:29:22.9720142Z DEBUG: urllib3.connectionpool: https://<redacted>.azurecr.io:443 "GET /v2/ HTTP/1.1" 401 149
2024-04-13T00:29:22.9722722Z INFO: cli.azure.cli.command_modules.acr._docker_utils: Attempting to retrieve AAD refresh token...
2024-04-13T00:29:22.9723502Z DEBUG: cli.azure.cli.command_modules.acr._docker_utils: 2024-04-13 00:29:22.972077 Sending a HTTP Get request to https://<redacted>.azurecr.io/v2/
2024-04-13T00:29:22.9741305Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): <redacted>.azurecr.io:443
2024-04-13T00:29:23.1230723Z DEBUG: urllib3.connectionpool: https://<redacted>.azurecr.io:443 "GET /v2/ HTTP/1.1" 401 149
2024-04-13T00:29:23.1255321Z DEBUG: urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
2024-04-13T00:29:23.1259163Z DEBUG: msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/<redacted>/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/<redacted>/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/<redacted>/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/<redacted>/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/<redacted>/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/<redacted>/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/<redacted>/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'}
2024-04-13T00:29:23.1261046Z DEBUG: msal.application: Broker enabled? None
2024-04-13T00:29:23.1261500Z DEBUG: cli.azure.cli.core.auth.msal_authentication: ServicePrincipalCredential.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
2024-04-13T00:29:23.1262042Z DEBUG: msal.application: Cache hit an AT
2024-04-13T00:29:23.1262397Z DEBUG: msal.telemetry: Generate or reuse correlation_id: 9c73d699-2a2e-438a-9b81-686a0962ef15
2024-04-13T00:29:23.1262886Z DEBUG: cli.azure.cli.command_modules.acr._docker_utils: 2024-04-13 00:29:23.125305 Sending a HTTP Post request to https://<redacted>.azurecr.io/oauth2/exchange
2024-04-13T00:29:23.1279146Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): <redacted>.azurecr.io:443
2024-04-13T00:29:23.4668509Z DEBUG: urllib3.connectionpool: https://<redacted>.azurecr.io:443 "POST /oauth2/exchange HTTP/1.1" 401 0
2024-04-13T00:29:23.4676925Z WARNING: cli.azure.cli.command_modules.acr._docker_utils: Unable to get AAD authorization tokens with message: 2024-04-13 00:29:23.466780 An error occurred: CONNECTIVITY_REFRESH_TOKEN_ERROR
2024-04-13T00:29:23.4677579Z Access to registry '<redacted>.azurecr.io' was denied. Response code: 401. Please try running 'az login' again to refresh permissions.
2024-04-13T00:29:23.4678456Z WARNING: cli.azure.cli.command_modules.acr._docker_utils: Unable to get admin user credentials with message: The resource with name '<redacted>' and type 'Microsoft.ContainerRegistry/registries' could not be found in subscription '<redacted>)'.
2024-04-13T00:29:23.4679286Z DEBUG: cli.knack.prompting: No tty available.
2024-04-13T00:29:23.5665915Z DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last):
2024-04-13T00:29:23.5666755Z File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/acr/_docker_utils.py", line 435, in _get_credentials
2024-04-13T00:29:23.5667194Z username = prompt('Username: ')
2024-04-13T00:29:23.5667385Z ^^^^^^^^^^^^^^^^^^^^
2024-04-13T00:29:23.5667656Z File "/opt/az/lib/python3.11/site-packages/knack/prompting.py", line 32, in prompt
2024-04-13T00:29:23.5667943Z verify_is_a_tty()
2024-04-13T00:29:23.5668281Z File "/opt/az/lib/python3.11/site-packages/knack/prompting.py", line 28, in verify_is_a_tty
2024-04-13T00:29:23.5668592Z raise NoTTYException()
2024-04-13T00:29:23.5668762Z knack.prompting.NoTTYException
2024-04-13T00:29:23.5668934Z
2024-04-13T00:29:23.5669157Z During handling of the above exception, another exception occurred:
2024-04-13T00:29:23.5669294Z
2024-04-13T00:29:23.5669507Z Traceback (most recent call last):
2024-04-13T00:29:23.5669830Z File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
2024-04-13T00:29:23.5670129Z cmd_result = self.invocation.execute(args)
2024-04-13T00:29:23.5670310Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-13T00:29:23.5670636Z File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 664, in execute
2024-04-13T00:29:23.5670933Z raise ex
2024-04-13T00:29:23.5671293Z File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 731, in _run_jobs_serially
2024-04-13T00:29:23.5671638Z results.append(self._run_job(expanded_arg, cmd_copy))
2024-04-13T00:29:23.5671823Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-13T00:29:23.5672165Z File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 701, in _run_job
2024-04-13T00:29:23.5672471Z result = cmd_copy(params)
2024-04-13T00:29:23.5672632Z ^^^^^^^^^^^^^^^^
2024-04-13T00:29:23.5672952Z File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 334, in __call__
2024-04-13T00:29:23.5673268Z return self.handler(*args, **kwargs)
2024-04-13T00:29:23.5673443Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-13T00:29:23.5673789Z File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
2024-04-13T00:29:23.5674089Z return op(**command_args)
2024-04-13T00:29:23.5674251Z ^^^^^^^^^^^^^^^^^^
2024-04-13T00:29:23.5674591Z File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/acr/custom.py", line 299, in acr_login
2024-04-13T00:29:23.5674921Z login_server, username, password = get_login_credentials(
2024-04-13T00:29:23.5675103Z ^^^^^^^^^^^^^^^^^^^^^^
2024-04-13T00:29:23.5675553Z File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/acr/_docker_utils.py", line 464, in get_login_credentials
2024-04-13T00:29:23.5676209Z return _get_credentials(cmd,
2024-04-13T00:29:23.5676378Z ^^^^^^^^^^^^^^^^^^^^^
2024-04-13T00:29:23.5676736Z File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/acr/_docker_utils.py", line 442, in _get_credentials
2024-04-13T00:29:23.5677043Z raise CLIError(
2024-04-13T00:29:23.5677464Z knack.util.CLIError: Unable to authenticate using AAD or admin login credentials. Please specify both username and password in non-interactive mode.
2024-04-13T00:29:23.5677697Z
2024-04-13T00:29:23.5790529Z ERROR: cli.azure.cli.core.azclierror: Unable to authenticate using AAD or admin login credentials. Please specify both username and password in non-interactive mode.
2024-04-13T00:29:23.5791432Z ERROR: az_command_data_logger: Unable to authenticate using AAD or admin login credentials. Please specify both username and password in non-interactive mode.
2024-04-13T00:29:23.5791799Z DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f5524f1df80>]
2024-04-13T00:29:23.5792036Z INFO: az_command_data_logger: exit code: 1
2024-04-13T00:29:23.5792257Z INFO: cli.__main__: Command ran in 1.584 seconds (init: 0.185, invoke: 1.399)
2024-04-13T00:29:23.6567522Z INFO: telemetry.main: Begin splitting cli events and extra events, total events: 1
2024-04-13T00:29:23.6568308Z INFO: telemetry.client: Accumulated 0 events. Flush the clients.
2024-04-13T00:29:23.6568921Z INFO: telemetry.main: Finish splitting cli events and extra events, cli events: 1
2024-04-13T00:29:23.6573167Z INFO: telemetry.save: Save telemetry record of length 3890 in cache
2024-04-13T00:29:23.6573649Z INFO: telemetry.main: Begin creating telemetry upload process.
2024-04-13T00:29:23.6574789Z INFO: telemetry.process: Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.11/site-packages/azure/cli/telemetry/__init__.py /home/vsts/work/_temp/.azclitask"
2024-04-13T00:29:23.6580524Z INFO: telemetry.process: Return from creating process
2024-04-13T00:29:23.6580951Z INFO: telemetry.main: Finish creating telemetry upload process.2024-04-13T00:29:22.1811183Z DEBUG: cli.knack.cli: Command arguments: ['acr', 'login', '--name', '<redacted>', '--debug']
2024-04-13T00:29:22.1811494Z DEBUG: cli.knack.cli: __init__ debug log:
2024-04-13T00:29:22.1811655Z Cannot enable color.
2024-04-13T00:29:22.1811901Z DEBUG: cli.knack.cli: Event: Cli.PreExecute []
2024-04-13T00:29:22.1812274Z DEBUG: cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f5525e140e0>, <function OutputProducer.on_global_arguments at 0x7f5525dbe200>, <function CLIQuery.on_global_arguments at 0x7f5525df7ce0>]
2024-04-13T00:29:22.1825505Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
2024-04-13T00:29:22.1831382Z DEBUG: cli.azure.cli.core: Modules found from index for 'acr': ['azure.cli.command_modules.acr']
2024-04-13T00:29:22.1831935Z DEBUG: cli.azure.cli.core: Loading command modules:
2024-04-13T00:29:22.1832614Z DEBUG: cli.azure.cli.core: Name Load Time Groups Commands
2024-04-13T00:29:22.2893694Z DEBUG: cli.azure.cli.core: acr 0.106 36 149
2024-04-13T00:29:22.2894466Z DEBUG: cli.azure.cli.core: Total (1) 0.106 36 149
2024-04-13T00:29:22.2900187Z DEBUG: cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
2024-04-13T00:29:22.2900649Z DEBUG: cli.azure.cli.core: Loading extensions:
2024-04-13T00:29:22.2901071Z DEBUG: cli.azure.cli.core: Name Load Time Groups Commands Directory
2024-04-13T00:29:22.2901612Z DEBUG: cli.azure.cli.core: Total (0) 0.000 0 0
2024-04-13T00:29:22.2904014Z DEBUG: cli.azure.cli.core: Loaded 36 groups, 149 commands.
2024-04-13T00:29:22.2904438Z DEBUG: cli.azure.cli.core: Found a match in the command table.
2024-04-13T00:29:22.2906960Z DEBUG: cli.azure.cli.core: Raw command : acr login
2024-04-13T00:29:22.2907313Z DEBUG: cli.azure.cli.core: Command table: acr login
2024-04-13T00:29:22.2908976Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f5524f1dd00>]
2024-04-13T00:29:22.2909695Z DEBUG: cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/vsts/work/_temp/.azclitask/commands/2024-04-13.00-29-22.acr_login.1705.log'.
2024-04-13T00:29:22.2917083Z INFO: az_command_data_logger: command args: acr login --name {} --debug
2024-04-13T00:29:22.2917656Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x7f5524d0ade0>]
2024-04-13T00:29:22.4088995Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
2024-04-13T00:29:22.4089955Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x7f5524d2e020>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x7f5524d2e160>]
2024-04-13T00:29:22.4098490Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
2024-04-13T00:29:22.4099004Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
2024-04-13T00:29:22.4102846Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f5525dbe2a0>, <function CLIQuery.handle_query_parameter at 0x7f5525df7d80>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x7f5524d2e0c0>]
2024-04-13T00:29:22.5479615Z DEBUG: cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ResourceManagementClient
2024-04-13T00:29:22.5571401Z DEBUG: cli.azure.cli.core.auth.persistence: build_persistence: location='/home/vsts/work/_temp/.azclitask/service_principal_entries.json', encrypt=False
2024-04-13T00:29:22.5572804Z DEBUG: cli.azure.cli.core.auth.persistence: build_persistence: location='/home/vsts/work/_temp/.azclitask/msal_token_cache.json', encrypt=False
2024-04-13T00:29:22.5576853Z DEBUG: cli.azure.cli.core.auth.binary_cache: load: /home/vsts/work/_temp/.azclitask/msal_http_cache.bin
2024-04-13T00:29:22.5577548Z DEBUG: urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
2024-04-13T00:29:22.5585938Z DEBUG: msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/<redacted>/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/<redacted>/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/<redacted>/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/<redacted>/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/<redacted>/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/<redacted>/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/<redacted>/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'}
2024-04-13T00:29:22.5588370Z DEBUG: msal.application: Broker enabled? None
2024-04-13T00:29:22.5773272Z DEBUG: cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
2024-04-13T00:29:22.5774402Z DEBUG: cli.azure.cli.core.auth.msal_authentication: ServicePrincipalCredential.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
2024-04-13T00:29:22.5775230Z DEBUG: msal.telemetry: Generate or reuse correlation_id: be26c6e8-ae79-49e3-9861-97d5e01a45a9
2024-04-13T00:29:22.5796757Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): login.microsoftonline.com:443
2024-04-13T00:29:22.6974737Z DEBUG: urllib3.connectionpool: https://login.microsoftonline.com:443 "POST /<redacted>/oauth2/v2.0/token HTTP/1.1" 200 1500
2024-04-13T00:29:22.6983348Z DEBUG: msal.token_cache: event={
2024-04-13T00:29:22.6984228Z "client_id": "***",
2024-04-13T00:29:22.6985147Z "data": {
2024-04-13T00:29:22.6985435Z "claims": "{\"access_token\": {\"xms_cc\": {\"values\": [\"CP1\"]}}}",
2024-04-13T00:29:22.6985632Z "scope": [
2024-04-13T00:29:22.6985879Z "https://management.core.windows.net//.default"
2024-04-13T00:29:22.6986069Z ]
2024-04-13T00:29:22.6986210Z },
2024-04-13T00:29:22.6986372Z "environment": "login.microsoftonline.com",
2024-04-13T00:29:22.6986601Z "grant_type": "client_credentials",
2024-04-13T00:29:22.6986782Z "params": null,
2024-04-13T00:29:22.6986941Z "response": {
2024-04-13T00:29:22.6987376Z "access_token": "********",
2024-04-13T00:29:22.6987553Z "expires_in": 3599,
2024-04-13T00:29:22.6987727Z "ext_expires_in": 3599,
2024-04-13T00:29:22.6987930Z "token_type": "Bearer"
2024-04-13T00:29:22.6988083Z },
2024-04-13T00:29:22.6988229Z "scope": [
2024-04-13T00:29:22.6988403Z "https://management.core.windows.net//.default"
2024-04-13T00:29:22.6988585Z ],
2024-04-13T00:29:22.6989105Z "token_endpoint": "https://login.microsoftonline.com/<redacted>/oauth2/v2.0/token"
2024-04-13T00:29:22.6989333Z }
2024-04-13T00:29:22.7012645Z DEBUG: cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/<redacted>/resources?$filter=resourceType%20eq%20%27Microsoft.ContainerRegistry%2Fregistries%27&api-version=2022-09-01'
2024-04-13T00:29:22.7013417Z DEBUG: cli.azure.cli.core.sdk.policies: Request method: 'GET'
2024-04-13T00:29:22.7013725Z DEBUG: cli.azure.cli.core.sdk.policies: Request headers:
2024-04-13T00:29:22.7014076Z DEBUG: cli.azure.cli.core.sdk.policies: 'Accept': 'application/json'
2024-04-13T00:29:22.7014521Z DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': 'dfa3c9cf-f92c-11ee-a987-d3ac0370acb8'
2024-04-13T00:29:22.7014916Z DEBUG: cli.azure.cli.core.sdk.policies: 'CommandName': 'acr login'
2024-04-13T00:29:22.7015280Z DEBUG: cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--name --debug'
2024-04-13T00:29:22.7015965Z DEBUG: cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.59.0 (DEB) azsdk-python-core/1.28.0 Python/3.11.8 (Linux-6.5.0-1017-azure-x86_64-with-glibc2.35) VSTS_afc33be0-a12e-4fd7-986e-ceadda2e1b93_build_896_0'
2024-04-13T00:29:22.7016463Z DEBUG: cli.azure.cli.core.sdk.policies: 'Authorization': '*****'
2024-04-13T00:29:22.7016715Z DEBUG: cli.azure.cli.core.sdk.policies: Request body:
2024-04-13T00:29:22.7016948Z DEBUG: cli.azure.cli.core.sdk.policies: This request has no body
2024-04-13T00:29:22.7051387Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
2024-04-13T00:29:22.8061514Z DEBUG: urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/<redacted>/resources?$filter=resourceType%20eq%20%27Microsoft.ContainerRegistry%2Fregistries%27&api-version=2022-09-01 HTTP/1.1" 200 12
2024-04-13T00:29:22.8070144Z DEBUG: cli.azure.cli.core.sdk.policies: Response status: 200
2024-04-13T00:29:22.8070689Z DEBUG: cli.azure.cli.core.sdk.policies: Response headers:
2024-04-13T00:29:22.8071971Z DEBUG: cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache'
2024-04-13T00:29:22.8072519Z DEBUG: cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache'
2024-04-13T00:29:22.8072998Z DEBUG: cli.azure.cli.core.sdk.policies: 'Content-Length': '12'
2024-04-13T00:29:22.8073588Z DEBUG: cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8'
2024-04-13T00:29:22.8074286Z DEBUG: cli.azure.cli.core.sdk.policies: 'Expires': '-1'
2024-04-13T00:29:22.8077911Z DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '9efda154-d798-494d-9a1e-241314e7b053'
2024-04-13T00:29:22.8078536Z DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '9efda154-d798-494d-9a1e-241314e7b053'
2024-04-13T00:29:22.8081362Z DEBUG: cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'CENTRALUS:20240413T002922Z:9efda154-d798-494d-9a1e-241314e7b053'
2024-04-13T00:29:22.8082080Z DEBUG: cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
2024-04-13T00:29:22.8082660Z DEBUG: cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff'
2024-04-13T00:29:22.8083159Z DEBUG: cli.azure.cli.core.sdk.policies: 'X-Cache': 'CONFIG_NOCACHE'
2024-04-13T00:29:22.8083842Z DEBUG: cli.azure.cli.core.sdk.policies: 'X-MSEdge-Ref': 'Ref A: 3CAEAD68EF4C42428E92D46FEA2F12D8 Ref B: DM2AA1091214045 Ref C: 2024-04-13T00:29:22Z'
2024-04-13T00:29:22.8110945Z DEBUG: cli.azure.cli.core.sdk.policies: 'Date': 'Sat, 13 Apr 2024 00:29:22 GMT'
2024-04-13T00:29:22.8111541Z DEBUG: cli.azure.cli.core.sdk.policies: Response content:
2024-04-13T00:29:22.8112185Z DEBUG: cli.azure.cli.core.sdk.policies: {"value":[]}
2024-04-13T00:29:22.8113058Z DEBUG: cli.azure.cli.command_modules.acr._docker_utils: Could not get registry from service. Exception: The resource with name '<redacted>' and type 'Microsoft.ContainerRegistry/registries' could not be found in subscription '<redacted>)'.
2024-04-13T00:29:22.8113917Z DEBUG: cli.azure.cli.command_modules.acr._docker_utils: 2024-04-13 00:29:22.808401 Sending a HTTP Get request to https://<redacted>.azurecr.io/v2/
2024-04-13T00:29:22.8114246Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): <redacted>.azurecr.io:443
2024-04-13T00:29:22.9720142Z DEBUG: urllib3.connectionpool: https://<redacted>.azurecr.io:443 "GET /v2/ HTTP/1.1" 401 149
2024-04-13T00:29:22.9722722Z INFO: cli.azure.cli.command_modules.acr._docker_utils: Attempting to retrieve AAD refresh token...
2024-04-13T00:29:22.9723502Z DEBUG: cli.azure.cli.command_modules.acr._docker_utils: 2024-04-13 00:29:22.972077 Sending a HTTP Get request to https://<redacted>.azurecr.io/v2/
2024-04-13T00:29:22.9741305Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): <redacted>.azurecr.io:443
2024-04-13T00:29:23.1230723Z DEBUG: urllib3.connectionpool: https://<redacted>.azurecr.io:443 "GET /v2/ HTTP/1.1" 401 149
2024-04-13T00:29:23.1255321Z DEBUG: urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
2024-04-13T00:29:23.1259163Z DEBUG: msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/<redacted>/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/<redacted>/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/<redacted>/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/<redacted>/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/<redacted>/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/<redacted>/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/<redacted>/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'}
2024-04-13T00:29:23.1261046Z DEBUG: msal.application: Broker enabled? None
2024-04-13T00:29:23.1261500Z DEBUG: cli.azure.cli.core.auth.msal_authentication: ServicePrincipalCredential.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
2024-04-13T00:29:23.1262042Z DEBUG: msal.application: Cache hit an AT
2024-04-13T00:29:23.1262397Z DEBUG: msal.telemetry: Generate or reuse correlation_id: 9c73d699-2a2e-438a-9b81-686a0962ef15
2024-04-13T00:29:23.1262886Z DEBUG: cli.azure.cli.command_modules.acr._docker_utils: 2024-04-13 00:29:23.125305 Sending a HTTP Post request to https://<redacted>.azurecr.io/oauth2/exchange
2024-04-13T00:29:23.1279146Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): <redacted>.azurecr.io:443
2024-04-13T00:29:23.4668509Z DEBUG: urllib3.connectionpool: https://<redacted>.azurecr.io:443 "POST /oauth2/exchange HTTP/1.1" 401 0
2024-04-13T00:29:23.4676925Z WARNING: cli.azure.cli.command_modules.acr._docker_utils: Unable to get AAD authorization tokens with message: 2024-04-13 00:29:23.466780 An error occurred: CONNECTIVITY_REFRESH_TOKEN_ERROR
2024-04-13T00:29:23.4677579Z Access to registry '<redacted>.azurecr.io' was denied. Response code: 401. Please try running 'az login' again to refresh permissions.
2024-04-13T00:29:23.4678456Z WARNING: cli.azure.cli.command_modules.acr._docker_utils: Unable to get admin user credentials with message: The resource with name '<redacted>' and type 'Microsoft.ContainerRegistry/registries' could not be found in subscription '<redacted>)'.
2024-04-13T00:29:23.4679286Z DEBUG: cli.knack.prompting: No tty available.
2024-04-13T00:29:23.5665915Z DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last):
2024-04-13T00:29:23.5666755Z File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/acr/_docker_utils.py", line 435, in _get_credentials
2024-04-13T00:29:23.5667194Z username = prompt('Username: ')
2024-04-13T00:29:23.5667385Z ^^^^^^^^^^^^^^^^^^^^
2024-04-13T00:29:23.5667656Z File "/opt/az/lib/python3.11/site-packages/knack/prompting.py", line 32, in prompt
2024-04-13T00:29:23.5667943Z verify_is_a_tty()
2024-04-13T00:29:23.5668281Z File "/opt/az/lib/python3.11/site-packages/knack/prompting.py", line 28, in verify_is_a_tty
2024-04-13T00:29:23.5668592Z raise NoTTYException()
2024-04-13T00:29:23.5668762Z knack.prompting.NoTTYException
2024-04-13T00:29:23.5668934Z
2024-04-13T00:29:23.5669157Z During handling of the above exception, another exception occurred:
2024-04-13T00:29:23.5669294Z
2024-04-13T00:29:23.5669507Z Traceback (most recent call last):
2024-04-13T00:29:23.5669830Z File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
2024-04-13T00:29:23.5670129Z cmd_result = self.invocation.execute(args)
2024-04-13T00:29:23.5670310Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-13T00:29:23.5670636Z File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 664, in execute
2024-04-13T00:29:23.5670933Z raise ex
2024-04-13T00:29:23.5671293Z File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 731, in _run_jobs_serially
2024-04-13T00:29:23.5671638Z results.append(self._run_job(expanded_arg, cmd_copy))
2024-04-13T00:29:23.5671823Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-13T00:29:23.5672165Z File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 701, in _run_job
2024-04-13T00:29:23.5672471Z result = cmd_copy(params)
2024-04-13T00:29:23.5672632Z ^^^^^^^^^^^^^^^^
2024-04-13T00:29:23.5672952Z File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 334, in __call__
2024-04-13T00:29:23.5673268Z return self.handler(*args, **kwargs)
2024-04-13T00:29:23.5673443Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-13T00:29:23.5673789Z File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
2024-04-13T00:29:23.5674089Z return op(**command_args)
2024-04-13T00:29:23.5674251Z ^^^^^^^^^^^^^^^^^^
2024-04-13T00:29:23.5674591Z File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/acr/custom.py", line 299, in acr_login
2024-04-13T00:29:23.5674921Z login_server, username, password = get_login_credentials(
2024-04-13T00:29:23.5675103Z ^^^^^^^^^^^^^^^^^^^^^^
2024-04-13T00:29:23.5675553Z File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/acr/_docker_utils.py", line 464, in get_login_credentials
2024-04-13T00:29:23.5676209Z return _get_credentials(cmd,
2024-04-13T00:29:23.5676378Z ^^^^^^^^^^^^^^^^^^^^^
2024-04-13T00:29:23.5676736Z File "/opt/az/lib/python3.11/site-packages/azure/cli/command_modules/acr/_docker_utils.py", line 442, in _get_credentials
2024-04-13T00:29:23.5677043Z raise CLIError(
2024-04-13T00:29:23.5677464Z knack.util.CLIError: Unable to authenticate using AAD or admin login credentials. Please specify both username and password in non-interactive mode.
2024-04-13T00:29:23.5677697Z
2024-04-13T00:29:23.5790529Z ERROR: cli.azure.cli.core.azclierror: Unable to authenticate using AAD or admin login credentials. Please specify both username and password in non-interactive mode.
2024-04-13T00:29:23.5791432Z ERROR: az_command_data_logger: Unable to authenticate using AAD or admin login credentials. Please specify both username and password in non-interactive mode.
2024-04-13T00:29:23.5791799Z DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f5524f1df80>]
2024-04-13T00:29:23.5792036Z INFO: az_command_data_logger: exit code: 1
2024-04-13T00:29:23.5792257Z INFO: cli.__main__: Command ran in 1.584 seconds (init: 0.185, invoke: 1.399)
2024-04-13T00:29:23.6567522Z INFO: telemetry.main: Begin splitting cli events and extra events, total events: 1
2024-04-13T00:29:23.6568308Z INFO: telemetry.client: Accumulated 0 events. Flush the clients.
2024-04-13T00:29:23.6568921Z INFO: telemetry.main: Finish splitting cli events and extra events, cli events: 1
2024-04-13T00:29:23.6573167Z INFO: telemetry.save: Save telemetry record of length 3890 in cache
2024-04-13T00:29:23.6573649Z INFO: telemetry.main: Begin creating telemetry upload process.
2024-04-13T00:29:23.6574789Z INFO: telemetry.process: Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.11/site-packages/azure/cli/telemetry/__init__.py /home/vsts/work/_temp/.azclitask"
2024-04-13T00:29:23.6580524Z INFO: telemetry.process: Return from creating process
2024-04-13T00:29:23.6580951Z INFO: telemetry.main: Finish creating telemetry upload process.
Expected behavior
Shouldn't throw any error
Environment Summary
Azure DevOps Microsoft provided build agent: ubuntu-latest
Describe the bug
I'm using Azure DevOps pipelines to run an AzureCLI@2, which performs
az acr login -n <repo-name>
. It is using a Azure ARM service connection with workload identity federation with openid connect. The task successfully logs in to azure just fine. When the acr login command is executed, I get an error.Related command
az acr login -n
Errors
WARNING: Unable to get AAD authorization tokens with message: 2024-04-13 00:15:05.762436 An error occurred: CONNECTIVITY_REFRESH_TOKEN_ERROR Access to registry '.azurecr.io' was denied. Response code: 401. Please try running 'az login' again to refresh permissions.
WARNING: Unable to get admin user credentials with message: The resource with name '' and type 'Microsoft.ContainerRegistry/registries' could not be found in subscription ')'.
ERROR: Unable to authenticate using AAD or admin login credentials. Please specify both username and password in non-interactive mode.
Issue script & Debug output
Expected behavior
Shouldn't throw any error
Environment Summary
Azure DevOps Microsoft provided build agent: ubuntu-latest
Additional context
No response