Describe the bug
I'm trying to create pull requests from the command line, with the following command:
az repos pr create --organization https://dev.azure.com/xxx --project APIM-Mngt --source-branch "refs/heads/api-test-model" --target-branch "refs/heads/dev" --title "PR TEST" --delete-source-branch "true" --auto-complete "true" --repository "apim-cd" --optional-reviewers felipe@hotmail.com --required-reviewers felipe@hotmail.com admin@abcd.dev.br
However, when there is the same email in the --optional-reviewers and --required-reviewers parameters (in the example above, the same email in both parameters is felipe@hotmail.com) the cli returns the following error message:
TF400898: An Internal Error Occurred. Activity Id: 478d85c6-a63d-445a-828c-808501f52a09.
Obviously, the Activity Id is always updated with each execution.
Related command
az repos pr create --organization https://dev.azure.com/xxx--project APIM-Mngt --source-branch "refs/heads/api-test-model" --target-branch "refs/heads/dev" --title "PR TEST" --delete-source-branch "true" --auto-complete "true" --repository "apim-cd" --optional-reviewers felipe@hotmail.com --required-reviewers felipe@hotmail.com admin@abcd.dev.br
Errors
TF400898: An Internal Error Occurred. Activity Id: 478d85c6-a63d-445a-828c-808501f52a09.
Issue script & Debug output
cli.knack.cli: Command arguments: ['repos', 'pr', 'create', '--organization', 'https://dev.azure.com/xpto', '--project', 'APIM-Mngt', '--source-branch', 'refs/heads/api-test-model', '--target-branch', 'refs/heads/dev', '--title', 'PR TEST', '--delete-source-branch', 'true', '--auto-complete', 'true', '--repository', 'apim-cd', '--optional-reviewers', 'felipe@hotmail.com', '--required-reviewers', 'felipe@hotmail.com', 'admin@xpto.dev.br', '--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 0x000002095747B7E0>, <function OutputProducer.on_global_arguments at 0x0000020957606020>, <function CLIQuery.on_global_arguments at 0x0000020957633BA0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'repos': ['azext_devops']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: Total (0) 0.000 0 0
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: azure-devops 0.195 60 192 C:\Users\felipe.azure\cliextensions\azure-devops
cli.azure.cli.core: Total (1) 0.195 60 192
cli.azure.cli.core: Loaded 60 groups, 192 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : repos pr create
cli.azure.cli.core: Command table: repos pr create
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x000002095983FE20>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\felipe.azure\commands\2024-09-16.15-33-12.repos_pr_create.10132.log'.
az_command_data_logger: command args: repos pr create --organization {} --project {} --source-branch {} --target-branch {} --title {} --delete-source-branch {} --auto-complete {} --repository {} --optional-reviewers {} --required-reviewers {} {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x00000209598767A0>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x00000209598B8860>, <function register_cache_arguments..add_cache_arguments at 0x00000209598B89A0>, <function register_upcoming_breaking_change_info..update_breaking_change_info at 0x00000209598B8A40>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x00000209576060C0>, <function CLIQuery.handle_query_parameter at 0x0000020957633C40>, <function register_ids_argument..parse_ids_arguments at 0x00000209598B8900>, <function DevCommandsLoader.post_parse_args at 0x00000209598EB560>]
az_command_data_logger: extension name: azure-devops
az_command_data_logger: extension version: 1.0.1
cli.azext_devops.dev.common._credentials: Getting credential: azdevops-cli:https://dev.azure.com/xpto
keyring.backend: Loading KWallet
keyring.backend: Loading SecretService
keyring.backend: Loading Windows
win32ctypes.core.cffi: Loaded cffi backend
keyring.backend: Loading chainer
keyring.backend: Loading macOS
cli.azext_devops.dev.common.credential_store: Keyring backend : keyring.backends.Windows.WinVaultKeyring (priority: 5)
cli.azext_devops.dev.common._credentials: Getting credential: azdevops-cli: default
cli.azext_devops.dev.common.credential_store: Keyring backend : keyring.backends.Windows.WinVaultKeyring (priority: 5)
cli.azext_devops.dev.common.services: PAT is present which can be used against this instance
cli.azure.cli.core: Current cloud config:
AzureCloud
cli.azext_devops.dev.common.services: trying to get token (temp) for tenant 5ec0b457-334c-4d27-91b0-d2a38b330948 and user felipe@hotmail.com
cli.azure.cli.core.auth.persistence: build_persistence: location='C:\Users\felipe\.azure\msal_token_cache.bin', encrypt=True
cli.azure.cli.core.auth.binary_cache: load: C:\Users\felipe.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: Initializing with Entra authority: https://login.microsoftonline.com/5ec0b457-334c-4d27-91b0-d2a38b330948
msal.authority: openid_config("https://login.microsoftonline.com/5ec0b457-334c-4d27-91b0-d2a38b330948/v2.0/.well-known/openid-configuration") = {'token_endpoint': 'https://login.microsoftonline.com/5ec0b457-334c-4d27-91b0-d2a38b330948/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/5ec0b457-334c-4d27-91b0-d2a38b330948/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/5ec0b457-334c-4d27-91b0-d2a38b330948/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/5ec0b457-334c-4d27-91b0-d2a38b330948/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/5ec0b457-334c-4d27-91b0-d2a38b330948/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/5ec0b457-334c-4d27-91b0-d2a38b330948/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/5ec0b457-334c-4d27-91b0-d2a38b330948/kerberos', 'tenant_region_scope': 'SA', '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? None
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('499b84ac-1321-427f-aa17-267ca6975798/.default',), claims=None, kwargs={}
msal.application: Cache hit an AT
msal.telemetry: Generate or reuse correlation_id: f6b71198-6343-4360-89af-9775722951a9
cli.azext_devops.dev.common.services: instance recieved in validate_token_for_instance https://dev.azure.com/xpto
cli.azext_devops.dev.common.services: instance processed in validate_token_for_instance https://dev.azure.com/xpto
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk._file_cache: Loading cache file: C:\Users\felipe.azure-devops\python-sdk\cache\resources.json
azext_devops.devops_sdk._file_cache: attempting to read file C:\Users\felipe.azure-devops\python-sdk\cache\resources.json as utf-8-sig
azext_devops.devops_sdk.connection: File cache hit for resources on: https://dev.azure.com/xpto
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk._file_cache: Loading cache file: C:\Users\felipe.azure-devops\python-sdk\cache\options.json
azext_devops.devops_sdk._file_cache: attempting to read file C:\Users\felipe.azure-devops\python-sdk\cache\options.json as utf-8-sig
azext_devops.devops_sdk.client: File cache hit for options on: https://dev.azure.com/xpto
azext_devops.devops_sdk.client: Route template: _apis/{resource}/{*projectId}
azext_devops.devops_sdk.client: Api version '5.0'
azext_devops.devops_sdk.client: GET https://dev.azure.com/xpto/_apis/projects?stateFilter=all&$top=1&$skip=0
azext_devops.devops_sdk.client: Request content: None
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: Starting new HTTPS connection (1): dev.azure.com:443
urllib3.connectionpool: https://dev.azure.com:443 "GET /felipe/_apis/projects?stateFilter=all&$top=1&$skip=0 HTTP/1.1" 401 343
azext_devops.devops_sdk.client: Response content: b'{"$id":"1","innerException":null,"message":"TF400813: The user 'e6f55502-6e0e-4f20-9fbf-04b91511c53c' is not authorized to access this resource.","typeName":"Microsoft.TeamFoundation.Framework.Server.UnauthorizedRequestException, Microsoft.TeamFoundation.Framework.Server","typeKey":"UnauthorizedRequestException","errorCode":0,"eventId":3000}'
msrest.exceptions: TF400813: The user 'e6f55502-6e0e-4f20-9fbf-04b91511c53c' is not authorized to access this resource.
cli.azext_devops.dev.common.services: TF400813: The user 'e6f55502-6e0e-4f20-9fbf-04b91511c53c' is not authorized to access this resource.
Traceback (most recent call last):
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 93, in validate_token_for_instance
core_client.get_projects(state_filter='all', top=1, skip=0)
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\v5_0\core\core_client.py", line 140, in get_projects
response = self._send(http_method='GET',
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 90, in _send
response = self._send_request(request=request, headers=headers, content=content, media_type=media_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 54, in _send_request
self._handle_error(request, response)
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 233, in _handle_error
raise AzureDevOpsServiceError(wrapped_exception)
azext_devops.devops_sdk.exceptions.AzureDevOpsServiceError: TF400813: The user 'e6f55502-6e0e-4f20-9fbf-04b91511c53c' is not authorized to access this resource.
cli.azext_devops.dev.common.services: Failed to connect using provided credentials
cli.azext_devops.dev.common.services: invalid token obtained for tenant 5ec0b457-334c-4d27-91b0-d2a38b330948
cli.azext_devops.dev.common.services: trying to get token (temp) for tenant e79034b6-c14f-4d3e-a08f-d8d7d4643271 and user felipe.pimentel@prestadores.amil.com.br
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.authority: Initializing with Entra authority: https://login.microsoftonline.com/e79034b6-c14f-4d3e-a08f-d8d7d4643271
msal.authority: openid_config("https://login.microsoftonline.com/e79034b6-c14f-4d3e-a08f-d8d7d4643271/v2.0/.well-known/openid-configuration") = {'token_endpoint': 'https://login.microsoftonline.com/e79034b6-c14f-4d3e-a08f-d8d7d4643271/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/e79034b6-c14f-4d3e-a08f-d8d7d4643271/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/e79034b6-c14f-4d3e-a08f-d8d7d4643271/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/e79034b6-c14f-4d3e-a08f-d8d7d4643271/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/e79034b6-c14f-4d3e-a08f-d8d7d4643271/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/e79034b6-c14f-4d3e-a08f-d8d7d4643271/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/e79034b6-c14f-4d3e-a08f-d8d7d4643271/kerberos', 'tenant_region_scope': 'SA', '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? None
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('499b84ac-1321-427f-aa17-267ca6975798/.default',), claims=None, kwargs={}
msal.application: Found 1 RTs matching {'environment': 'login.microsoftonline.com', 'home_account_id': '.9188040d-6c67-4c5b-b112-36a304b66dad', 'family_id': '1'}
msal.telemetry: Generate or reuse correlation_id: 49c42099-3cde-4057-84bb-386ec086f575
msal.application: Cache attempts an RT
cli.azure.cli.core.auth.binary_cache: save: C:\Users\felipe.azure\msal_http_cache.bin
cli.azure.cli.core.auth.binary_cache: save: C:\Users\felipe.azure\msal_http_cache.bin
urllib3.connectionpool: Starting new HTTPS connection (1): login.microsoftonline.com:443
urllib3.connectionpool: https://login.microsoftonline.com:443 "POST /e79034b6-c14f-4d3e-a08f-d8d7d4643271/oauth2/v2.0/token HTTP/1.1" 400 595
cli.azure.cli.core.auth.binary_cache: save: C:\Users\felipe.azure\msal_http_cache.bin
cli.azure.cli.core.auth.binary_cache: save: C:\Users\felipe.azure\msal_http_cache.bin
msal.application: Refresh failed. invalid_grant: AADSTS70043: The refresh token has expired or is invalid due to sign-in frequency checks by conditional access. The token was issued on 2024-08-08T15:01:30.6210240Z and the maximum allowed lifetime for this request is 604800. Trace ID: 9e03d90c-a291-4dec-8aed-5cace8af6300 Correlation ID: 49c42099-3cde-4057-84bb-386ec086f575 Timestamp: 2024-09-16 18:35:15Z
msal.application: Found 1 RTs matching {'environment': 'login.microsoftonline.com', 'home_account_id': '.9188040d-6c67-4c5b-b112-36a304b66dad', 'client_id': '04b07795-8ddb-461a-bbee-02f9e1bf7b46'}
msal.telemetry: Generate or reuse correlation_id: 49c42099-3cde-4057-84bb-386ec086f575
msal.application: Cache attempts an RT
msal.application: Refresh failed. invalid_grant: AADSTS70043: The refresh token has expired or is invalid due to sign-in frequency checks by conditional access. The token was issued on 2024-08-08T15:01:30.6210240Z and the maximum allowed lifetime for this request is 604800. Trace ID: 9e03d90c-a291-4dec-8aed-5cace8af6300 Correlation ID: 49c42099-3cde-4057-84bb-386ec086f575 Timestamp: 2024-09-16 18:35:15Z
cli.azext_devops.dev.common.services: not able to get token from az login
cli.azext_devops.dev.common.services: AADSTS70043: The refresh token has expired or is invalid due to sign-in frequency checks by conditional access. The token was issued on 2024-08-08T15:01:30.6210240Z and the maximum allowed lifetime for this request is 604800. Trace ID: 9e03d90c-a291-4dec-8aed-5cace8af6300 Correlation ID: 49c42099-3cde-4057-84bb-386ec086f575 Timestamp: 2024-09-16 18:35:15Z
Traceback (most recent call last):
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 157, in get_token_from_az_login
raw = profile.get_raw_token(
^^^^^^^^^^^^^^^^^^^^^^
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/_profile.py", line 415, in get_raw_token
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/auth/msal_authentication.py", line 74, in get_token
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/auth/util.py", line 139, in check_result
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/auth/util.py", line 43, in aad_error_handler
azure.cli.core.azclierror.AuthenticationError: AADSTS70043: The refresh token has expired or is invalid due to sign-in frequency checks by conditional access. The token was issued on 2024-08-08T15:01:30.6210240Z and the maximum allowed lifetime for this request is 604800. Trace ID: 9e03d90c-a291-4dec-8aed-5cace8af6300 Correlation ID: 49c42099-3cde-4057-84bb-386ec086f575 Timestamp: 2024-09-16 18:35:15Z
cli.azext_devops.dev.common.services: instance recieved in validate_token_for_instance https://dev.azure.com/xpto
cli.azext_devops.dev.common.services: instance processed in validate_token_for_instance https://dev.azure.com/xpto
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk.connection: File cache hit for resources on: https://dev.azure.com/xpto
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk.client: Route template: _apis/{resource}/{*projectId}
azext_devops.devops_sdk.client: Api version '5.0'
azext_devops.devops_sdk.client: GET https://dev.azure.com/xpto/_apis/projects?stateFilter=all&$top=1&$skip=0
azext_devops.devops_sdk.client: Request content: None
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: Starting new HTTPS connection (1): dev.azure.com:443
urllib3.connectionpool: https://dev.azure.com:443 "GET /felipe/_apis/projects?stateFilter=all&$top=1&$skip=0 HTTP/1.1" 401 343
azext_devops.devops_sdk.client: Response content: b'{"$id":"1","innerException":null,"message":"TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.","typeName":"Microsoft.TeamFoundation.Framework.Server.UnauthorizedRequestException, Microsoft.TeamFoundation.Framework.Server","typeKey":"UnauthorizedRequestException","errorCode":0,"eventId":3000}'
msrest.exceptions: TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.
cli.azext_devops.dev.common.services: TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.
Traceback (most recent call last):
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 93, in validate_token_for_instance
core_client.get_projects(state_filter='all', top=1, skip=0)
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\v5_0\core\core_client.py", line 140, in get_projects
response = self._send(http_method='GET',
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 90, in _send
response = self._send_request(request=request, headers=headers, content=content, media_type=media_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 54, in _send_request
self._handle_error(request, response)
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 233, in _handle_error
raise AzureDevOpsServiceError(wrapped_exception)
azext_devops.devops_sdk.exceptions.AzureDevOpsServiceError: TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.
cli.azext_devops.dev.common.services: Failed to connect using provided credentials
cli.azext_devops.dev.common.services: invalid token obtained for tenant e79034b6-c14f-4d3e-a08f-d8d7d4643271
cli.azext_devops.dev.common.services: trying to get token (temp) for tenant 6d23e42b-81f3-43f2-9d7d-19031a23c3f2 and user felipe@avanade.com
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.authority: Initializing with Entra authority: https://login.microsoftonline.com/6d23e42b-81f3-43f2-9d7d-19031a23c3f2
msal.authority: openid_config("https://login.microsoftonline.com/6d23e42b-81f3-43f2-9d7d-19031a23c3f2/v2.0/.well-known/openid-configuration") = {'token_endpoint': 'https://login.microsoftonline.com/6d23e42b-81f3-43f2-9d7d-19031a23c3f2/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/6d23e42b-81f3-43f2-9d7d-19031a23c3f2/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/6d23e42b-81f3-43f2-9d7d-19031a23c3f2/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/6d23e42b-81f3-43f2-9d7d-19031a23c3f2/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/6d23e42b-81f3-43f2-9d7d-19031a23c3f2/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/6d23e42b-81f3-43f2-9d7d-19031a23c3f2/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/6d23e42b-81f3-43f2-9d7d-19031a23c3f2/kerberos', 'tenant_region_scope': 'SA', '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? None
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('499b84ac-1321-427f-aa17-267ca6975798/.default',), claims=None, kwargs={}
msal.application: Cache hit an AT
msal.telemetry: Generate or reuse correlation_id: d684827e-1b99-450a-a887-42ac957a8647
cli.azext_devops.dev.common.services: instance recieved in validate_token_for_instance https://dev.azure.com/xpto
cli.azext_devops.dev.common.services: instance processed in validate_token_for_instance https://dev.azure.com/xpto
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk.connection: File cache hit for resources on: https://dev.azure.com/xpto
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk.client: Route template: _apis/{resource}/{*projectId}
azext_devops.devops_sdk.client: Api version '5.0'
azext_devops.devops_sdk.client: GET https://dev.azure.com/xpto/_apis/projects?stateFilter=all&$top=1&$skip=0
azext_devops.devops_sdk.client: Request content: None
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: Starting new HTTPS connection (1): dev.azure.com:443
urllib3.connectionpool: https://dev.azure.com:443 "GET /felipe/_apis/projects?stateFilter=all&$top=1&$skip=0 HTTP/1.1" 401 343
azext_devops.devops_sdk.client: Response content: b'{"$id":"1","innerException":null,"message":"TF400813: The user 'e6f55502-6e0e-4f20-9fbf-04b91511c53c' is not authorized to access this resource.","typeName":"Microsoft.TeamFoundation.Framework.Server.UnauthorizedRequestException, Microsoft.TeamFoundation.Framework.Server","typeKey":"UnauthorizedRequestException","errorCode":0,"eventId":3000}'
msrest.exceptions: TF400813: The user 'e6f55502-6e0e-4f20-9fbf-04b91511c53c' is not authorized to access this resource.
cli.azext_devops.dev.common.services: TF400813: The user 'e6f55502-6e0e-4f20-9fbf-04b91511c53c' is not authorized to access this resource.
Traceback (most recent call last):
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 93, in validate_token_for_instance
core_client.get_projects(state_filter='all', top=1, skip=0)
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\v5_0\core\core_client.py", line 140, in get_projects
response = self._send(http_method='GET',
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 90, in _send
response = self._send_request(request=request, headers=headers, content=content, media_type=media_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 54, in _send_request
self._handle_error(request, response)
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 233, in _handle_error
raise AzureDevOpsServiceError(wrapped_exception)
azext_devops.devops_sdk.exceptions.AzureDevOpsServiceError: TF400813: The user 'e6f55502-6e0e-4f20-9fbf-04b91511c53c' is not authorized to access this resource.
cli.azext_devops.dev.common.services: Failed to connect using provided credentials
cli.azext_devops.dev.common.services: invalid token obtained for tenant 6d23e42b-81f3-43f2-9d7d-19031a23c3f2
cli.azext_devops.dev.common._credentials: Getting credential: azdevops-cli:https://dev.azure.com/xpto
cli.azext_devops.dev.common.credential_store: Keyring backend : keyring.backends.Windows.WinVaultKeyring (priority: 5)
cli.azext_devops.dev.common._credentials: Getting credential: azdevops-cli: default
cli.azext_devops.dev.common.credential_store: Keyring backend : keyring.backends.Windows.WinVaultKeyring (priority: 5)
cli.azext_devops.dev.common.services: Creating connection with personal access token.
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
cli.azext_devops.dev.common.telemetry: Azure devops telemetry enabled.
cli.azext_devops.dev.common.telemetry: Logging telemetry to azure devops server.
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk.client: Route template: _apis/{area}/{resource}
azext_devops.devops_sdk.connection: File cache hit for resources on: https://dev.azure.com/xpto
azext_devops.devops_sdk.client: Api version '5.0-preview.1'
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk.client: POST https://dev.azure.com/xpto/_apis/CustomerIntelligence/Events
azext_devops.devops_sdk.client: Request content: [{'area': 'AzureDevopsCli', 'feature': 'repos', 'properties': {'Command': 'pr create', 'Args': 'project repository source_branch target_branch title organization', 'ShellType': 'cmd', 'IsInteractive': 'True', 'OutputType': 'json', 'OrgPresentInCommand': True, 'ProjectPresentInCommand': True, 'RepoPresentInCommand': True}}]
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: Starting new HTTPS connection (1): dev.azure.com:443
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk.client: File cache hit for options on: https://vssps.dev.azure.com/felipe
azext_devops.devops_sdk.client: Route template: _apis/{resource}/{identityId}
azext_devops.devops_sdk.client: Api version '5.0'
azext_devops.devops_sdk.client: GET https://vssps.dev.azure.com/felipe/_apis/Identities?searchFilter=General&filterValue=felipe%40hotmail.com
azext_devops.devops_sdk.client: Request content: None
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: Starting new HTTPS connection (1): vssps.dev.azure.com:443
urllib3.connectionpool: https://dev.azure.com:443 "POST /felipe/_apis/CustomerIntelligence/Events HTTP/1.1" 204 0
urllib3.connectionpool: https://vssps.dev.azure.com:443 "GET /felipe/_apis/Identities?searchFilter=General&filterValue=felipe%40hotmail.com HTTP/1.1" 200 795
azext_devops.devops_sdk.client: Response content: b'{"count":1,"value":[{"id":"e6f55502-6e0e-4f20-9fbf-04b91511c53c","descriptor":"Microsoft.IdentityModel.Claims.ClaimsIdentity;5ec0b457-334c-4d27-91b0-d2a38b330948\\felipe@hotmail.com","subjectDescriptor":"aad.MDdiNDY1ZDEtYjA4Mi03OGQzLWFiYWQtNTM0YTE5Y2UyNmVk","providerDisplayName":"Felipe Pimentel Augusto","customDisplayName":"Felipe Augusto","isActive":true,"members":[],"memberOf":[],"memberIds":[],"properties":{"SchemaClassName":{"$type":"System.String","$value":"User"},"Description":{"$type":"System.String","$value":""},"Domain":{"$type":"System.String","$value":"5ec0b457-334c-4d27-91b0-d2a38b330948"},"Account":{"$type":"System.String","$value":"felipe@hotmail.com"},"DN":{"$type":"System.String","$value":""},"Mail":{"$type":"System.String","$value":"felipe@hotmail.com"},"SpecialType":{"$type":"System.String","$value":"Generic"},"PUID":{"$type":"System.String","$value":"00018101A5C4C2E6"},"ComplianceValidated":{"$type":"System.DateTime","$value":"2024-09-16T00:00:00Z"},"http://schemas.microsoft.com/identity/claims/objectidentifier":{"$type":"System.String","$value":"22d60549-e51e-431f-a9fa-6819b3066d41"},"MetadataUpdateDate":{"$type":"System.DateTime","$value":"2021-02-24T01:55:21Z"},"DirectoryAlias":{"$type":"System.String","$value":"felipe_hotmail.com#EXT#"}},"resourceVersion":2,"metaTypeId":0}]}'
azext_devops.devops_sdk.client: Route template: _apis/{resource}/{identityId}
azext_devops.devops_sdk.client: Api version '5.0'
azext_devops.devops_sdk.client: GET https://vssps.dev.azure.com/felipe/_apis/Identities?searchFilter=General&filterValue=admin%40felipe.dev.br
azext_devops.devops_sdk.client: Request content: None
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: https://vssps.dev.azure.com:443 "GET /felipe/_apis/Identities?searchFilter=General&filterValue=admin%40felipe.dev.br HTTP/1.1" 200 776
azext_devops.devops_sdk.client: Response content: b'{"count":1,"value":[{"id":"a0032193-ac98-606f-85b2-75c1bf4308f7","descriptor":"Microsoft.IdentityModel.Claims.ClaimsIdentity;5ec0b457-334c-4d27-91b0-d2a38b330948\\admin@felipe.dev.br","subjectDescriptor":"aad.YTAwMzIxOTMtYWM5OC03MDZmLTg1YjItNzVjMWJmNDMwOGY3","providerDisplayName":"Felipe Augusto","isActive":true,"members":[],"memberOf":[],"memberIds":[],"properties":{"SchemaClassName":{"$type":"System.String","$value":"User"},"Description":{"$type":"System.String","$value":""},"Domain":{"$type":"System.String","$value":"5ec0b457-334c-4d27-91b0-d2a38b330948"},"Account":{"$type":"System.String","$value":"admin@felipe.dev.br"},"DN":{"$type":"System.String","$value":""},"Mail":{"$type":"System.String","$value":"admin@felipe.dev.br"},"SpecialType":{"$type":"System.String","$value":"Generic"},"PUID":{"$type":"System.String","$value":"aad:100320010A3638A9"},"ComplianceValidated":{"$type":"System.DateTime","$value":"2024-09-16T00:00:00Z"},"http://schemas.microsoft.com/identity/claims/objectidentifier":{"$type":"System.String","$value":"1919af9d-fb1f-4bfc-b042-68a851076501"},"MetadataUpdateDate":{"$type":"System.DateTime","$value":"2024-09-13T21:38:28Z"},"DirectoryAlias":{"$type":"System.String","$value":"userfelipe"}},"resourceVersion":2,"metaTypeId":0}]}'
azext_devops.devops_sdk.client: Route template: _apis/{resource}/{identityId}
azext_devops.devops_sdk.client: Api version '5.0'
azext_devops.devops_sdk.client: GET https://vssps.dev.azure.com/felipe/_apis/Identities?searchFilter=General&filterValue=felipe%40hotmail.com
azext_devops.devops_sdk.client: Request content: None
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: https://vssps.dev.azure.com:443 "GET /felipe/_apis/Identities?searchFilter=General&filterValue=felipe%40hotmail.com HTTP/1.1" 200 795
azext_devops.devops_sdk.client: Response content: b'{"count":1,"value":[{"id":"e6f55502-6e0e-4f20-9fbf-04b91511c53c","descriptor":"Microsoft.IdentityModel.Claims.ClaimsIdentity;5ec0b457-334c-4d27-91b0-d2a38b330948\\felipe@hotmail.com","subjectDescriptor":"aad.MDdiNDY1ZDEtYjA4Mi03OGQzLWFiYWQtNTM0YTE5Y2UyNmVk","providerDisplayName":"Felipe Pimentel Augusto","customDisplayName":"Felipe Augusto","isActive":true,"members":[],"memberOf":[],"memberIds":[],"properties":{"SchemaClassName":{"$type":"System.String","$value":"User"},"Description":{"$type":"System.String","$value":""},"Domain":{"$type":"System.String","$value":"5ec0b457-334c-4d27-91b0-d2a38b330948"},"Account":{"$type":"System.String","$value":"felipe@hotmail.com"},"DN":{"$type":"System.String","$value":""},"Mail":{"$type":"System.String","$value":"felipe@hotmail.com"},"SpecialType":{"$type":"System.String","$value":"Generic"},"PUID":{"$type":"System.String","$value":"00018101A5C4C2E6"},"ComplianceValidated":{"$type":"System.DateTime","$value":"2024-09-16T00:00:00Z"},"http://schemas.microsoft.com/identity/claims/objectidentifier":{"$type":"System.String","$value":"22d60549-e51e-431f-a9fa-6819b3066d41"},"MetadataUpdateDate":{"$type":"System.DateTime","$value":"2021-02-24T01:55:21Z"},"DirectoryAlias":{"$type":"System.String","$value":"felipe_hotmail.com#EXT#"}},"resourceVersion":2,"metaTypeId":0}]}'
azext_devops.devops_sdk.client: Route template: {project}/_apis/{area}/repositories/{repositoryId}/{resource}/{pullRequestId}
azext_devops.devops_sdk.client: Api version '5.0'
azext_devops.devops_sdk.client: POST https://dev.azure.com/xpto/APIM-Mngt/_apis/git/repositories/apim-cd/pullRequests
azext_devops.devops_sdk.client: Request content: {'reviewers': [{'id': 'e6f55502-6e0e-4f20-9fbf-04b91511c53c', 'isRequired': True}, {'id': 'a0032193-ac98-606f-85b2-75c1bf4308f7', 'isRequired': True}, {'id': 'e6f55502-6e0e-4f20-9fbf-04b91511c53c', 'isRequired': True}], 'sourceRefName': 'refs/heads/api-test-model', 'targetRefName': 'refs/heads/dev', 'title': 'PR TEST'}
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: Starting new HTTPS connection (1): dev.azure.com:443
urllib3.connectionpool: https://dev.azure.com:443 "POST /felipe/APIM-Mngt/_apis/git/repositories/apim-cd/pullRequests HTTP/1.1" 409 314
azext_devops.devops_sdk.client: Response content: b'{"$id":"1","innerException":null,"message":"TF401179: An active pull request for the source and target branch already exists.","typeName":"Microsoft.TeamFoundation.Git.Server.GitPullRequestExistsException, Microsoft.TeamFoundation.Git.Server","typeKey":"GitPullRequestExistsException","errorCode":0,"eventId":3000}'
msrest.exceptions: TF401179: An active pull request for the source and target branch already exists.
cli.azext_devops.dev.common.exception_handler: handling vsts service error
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 703, in _run_job
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 336, in call
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\dev\repos\pull_request.py", line 200, in create_pull_request
pr = client.create_pull_request(git_pull_request_to_create=pr, project=project,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\v5_0\git\git_client_base.py", line 1382, in create_pull_request
response = self._send(http_method='POST',
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 90, in _send
response = self._send_request(request=request, headers=headers, content=content, media_type=media_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 54, in _send_request
self._handle_error(request, response)
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 233, in _handle_error
raise AzureDevOpsServiceError(wrapped_exception)
azext_devops.devops_sdk.exceptions.AzureDevOpsServiceError: TF401179: An active pull request for the source and target branch already exists.
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\knack/cli.py", line 233, in invoke
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 666, in execute
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 733, in _run_jobs_serially
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 725, in _run_job
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\dev\common\exception_handler.py", line 18, in azure_devops_exception_handler
raise CLIError(ex)
knack.util.CLIError: TF401179: An active pull request for the source and target branch already exists.
cli.azure.cli.core.azclierror: TF401179: An active pull request for the source and target branch already exists.
az_command_data_logger: TF401179: An active pull request for the source and target branch already exists.
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x00000209598400E0>]
az_command_data_logger: exit code: 1
cli.main: Command ran in 5.385 seconds (init: 0.508, invoke: 4.877)
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 3958 in cache file under C:\Users\felipe.azure\telemetry\20240916153316987
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\felipe.azure C:\Users\felipe.azure\telemetry\20240916153316987"
telemetry.process: Return from creating process 4840
telemetry.main: Finish creating telemetry upload process.
Expected behavior
The expected result is the creation of the PR, as in the example below
{
"artifactId": "vstfs:///Git/PullRequestId/2d2f83bc-xxx%2f9feb1e01-bb94-xxx%2f176",
"autoCompleteSetBy": {
"descriptor": "aad.MDdiNDY1ZDEtYjA4Mi03OGQzLWFiYWQtNTM0YTE5Y2UyNmVk",
"directoryAlias": null,
"displayName": "Felipe Augusto",
"id": "e6f55502-xxx",
"imageUrl": "https://dev.azure.com/xpto/_api/_common/identityImage?id=e6f55502-xxx",
"inactive": null,
"isAadIdentity": null,
"isContainer": null,
"isDeletedInOrigin": null,
"profileUrl": null,
"uniqueName": "felipe@hotmail.com",
"url": "https://spsprodeus21.vssps.visualstudio.com/A97723661-xxx/_apis/Identities/e6f55502-xxx"
},
"closedBy": null,
"closedDate": null,
"codeReviewId": 176,
"commits": null,
"completionOptions": {
"bypassPolicy": null,
"bypassReason": null,
"deleteSourceBranch": true,
"mergeCommitMessage": null,
"mergeStrategy": "noFastForward",
"squashMerge": null,
"transitionWorkItems": null,
"triggeredByAutoComplete": null
},
"completionQueueTime": null,
"createdBy": {
"descriptor": "aad.MDdiNDY1ZDEtYjA4Mi03OGQzLWFiYWQtNTM0YTE5Y2UyNmVk",
"directoryAlias": null,
"displayName": "Felipe Augusto",
"id": "e6f55502-xxx",
"imageUrl": "https://dev.azure.com/xpto/_api/_common/identityImage?id=e6f55502-xxx",
"inactive": null,
"isAadIdentity": null,
"isContainer": null,
"isDeletedInOrigin": null,
"profileUrl": null,
"uniqueName": "felipe@hotmail.com",
"url": "https://spsprodeus21.vssps.visualstudio.com/A97723661-xxx/_apis/Identities/e6f55502-xxx"
},
"creationDate": "2024-09-16T18:28:58.941424+00:00",
"description": null,
"forkSource": null,
"isDraft": false,
"labels": null,
"lastMergeCommit": {
"author": {
"date": "2024-09-14T12:35:29+00:00",
"email": "Project Collection Build Service (felipementel)",
"imageUrl": null,
"name": "Project Collection Build Service (felipementel)"
},
"changeCounts": null,
"changes": null,
"comment": "Merge pull request 167 from api-teste_678_Build_202409.97 into dev",
"commentTruncated": null,
"commitId": "838bbc4fc7db014a021d3127a44de8b82483be37",
"committer": {
"date": "2024-09-14T12:35:29+00:00",
"email": "Project Collection Build Service (felipementel)",
"imageUrl": null,
"name": "Project Collection Build Service (felipementel)"
},
"parents": null,
"push": null,
"remoteUrl": null,
"statuses": null,
"url": "https://dev.azure.com/xpto/2d2f83bc-xxx/_apis/git/repositories/9feb1e01-bb94-xxx/commits/838bbc4fc7db014a021d3127a44de8b82483be37",
"workItems": null
},
"lastMergeSourceCommit": {
"author": null,
"changeCounts": null,
"changes": null,
"comment": null,
"commentTruncated": null,
"commitId": "3ece34635105d3e8992e73dcc0e347e533ee2535",
"committer": null,
"parents": null,
"push": null,
"remoteUrl": null,
"statuses": null,
"url": "https://dev.azure.com/xpto/2d2f83bc-xxx/_apis/git/repositories/9feb1e01-bb94-xxx/commits/3ece34635105d3e8992e73dcc0e347e533ee2535",
"workItems": null
},
"lastMergeTargetCommit": {
"author": null,
"changeCounts": null,
"changes": null,
"comment": null,
"commentTruncated": null,
"commitId": "838bbc4fc7db014a021d3127a44de8b82483be37",
"committer": null,
"parents": null,
"push": null,
"remoteUrl": null,
"statuses": null,
"url": "https://dev.azure.com/xpto/2d2f83bc-xxx/_apis/git/repositories/9feb1e01-bb94-xxx/commits/838bbc4fc7db014a021d3127a44de8b82483be37",
"workItems": null
},
"mergeFailureMessage": null,
"mergeFailureType": null,
"mergeId": "8a352d1f-894c-4771-aaa1-b5403ca49514",
"mergeOptions": null,
"mergeStatus": "succeeded",
"pullRequestId": 176,
"remoteUrl": null,
"repository": {
"defaultBranch": null,
"id": "9feb1e01-bb94-xxx",
"isDisabled": false,
"isFork": null,
"isInMaintenance": false,
"name": "apim-cd",
"parentRepository": null,
"project": {
"abbreviation": null,
"defaultTeamImageUrl": null,
"description": null,
"id": "2d2f83bc-xxx",
"lastUpdateTime": "2024-09-07T01:52:08.683Z",
"name": "APIM-Mngt",
"revision": 425900918,
"state": "wellFormed",
"url": "https://dev.azure.com/xpto/_apis/projects/2d2f83bc-xxx",
"visibility": "private"
},
"remoteUrl": "https://xpto@dev.azure.com/xpto/APIM-Mngt/_git/apim-cd",
"size": 462711,
"sshUrl": "git@ssh.dev.azure.com:v3/felipementel/APIM-Mngt/apim-cd",
"url": "https://dev.azure.com/xpto/2d2f83bc-xxx/_apis/git/repositories/9feb1e01-bb94-xxx",
"validRemoteUrls": null,
"webUrl": "https://dev.azure.com/xpto/APIM-Mngt/_git/apim-cd"
},
"reviewers": [
{
"descriptor": null,
"directoryAlias": null,
"displayName": "Felipe Augusto",
"hasDeclined": false,
"id": "e6f55502-xxx",
"imageUrl": "https://dev.azure.com/xpto/_api/_common/identityImage?id=e6f55502-xxx",
"inactive": null,
"isAadIdentity": null,
"isContainer": null,
"isDeletedInOrigin": null,
"isFlagged": false,
"isRequired": null,
"profileUrl": null,
"reviewerUrl": "https://dev.azure.com/xpto/2d2f83bc-xxx/_apis/git/repositories/9feb1e01-bb94-xxx/pullRequests/176/reviewers/e6f55502-xxx",
"uniqueName": "felipe@hotmail.com",
"url": "https://spsprodeus21.vssps.visualstudio.com/A97723661-xxx/_apis/Identities/e6f55502-xxx",
"vote": 0,
"votedFor": null
},
{
"descriptor": null,
"directoryAlias": null,
"displayName": "Felipe Augusto",
"hasDeclined": false,
"id": "a0032193-ac98-606f-85b2-75c1bf4308f7",
"imageUrl": "https://dev.azure.com/xpto/_api/_common/identityImage?id=a0032193-ac98-606f-85b2-75c1bf4308f7",
"inactive": null,
"isAadIdentity": null,
"isContainer": null,
"isDeletedInOrigin": null,
"isFlagged": false,
"isRequired": true,
"profileUrl": null,
"reviewerUrl": "https://dev.azure.com/xpto/2d2f83bc-xxx/_apis/git/repositories/9feb1e01-bb94-xxx/pullRequests/176/reviewers/a0032193-ac98-606f-85b2-75c1bf4308f7",
"uniqueName": "admin@felipementel.dev.br",
"url": "https://spsprodeus21.vssps.visualstudio.com/A97723661-xxx/_apis/Identities/a0032193-ac98-606f-85b2-75c1bf4308f7",
"vote": 0,
"votedFor": null
}
],
"sourceRefName": "refs/heads/api-test-model",
"status": "active",
"supportsIterations": true,
"targetRefName": "refs/heads/dev",
"title": "PR TEST",
"url": "https://dev.azure.com/xpto/2d2f83bc-xxx/_apis/git/repositories/9feb1e01-bb94-xxx/pullRequests/176",
"workItemRefs": null
}
Environment Summary
➜ az --version
azure-cli 2.64.0
core 2.64.0
telemetry 1.1.0
Extensions:
azure-devops 1.0.1
resource-graph 2.1.0
Dependencies:
msal 1.30.0
azure-mgmt-resource 23.1.1
Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\xxxxxxx.azure\cliextensions'
Python (Windows) 3.11.8 (tags/v3.11.8:db85d51, Feb 6 2024, 22:03:32) [MSC v.1937 64 bit (AMD64)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
This issue is impacting our production environment.
Describe the bug
I'm trying to create pull requests from the command line, with the following command:
However, when there is the same email in the --optional-reviewers and --required-reviewers parameters (in the example above, the same email in both parameters is felipe@hotmail.com) the cli returns the following error message:
Obviously, the Activity Id is always updated with each execution.
Related command
az repos pr create --organization https://dev.azure.com/xxx--project APIM-Mngt --source-branch "refs/heads/api-test-model" --target-branch "refs/heads/dev" --title "PR TEST" --delete-source-branch "true" --auto-complete "true" --repository "apim-cd" --optional-reviewers felipe@hotmail.com --required-reviewers felipe@hotmail.com admin@abcd.dev.br
Errors
TF400898: An Internal Error Occurred. Activity Id: 478d85c6-a63d-445a-828c-808501f52a09.
Issue script & Debug output
cli.knack.cli: Command arguments: ['repos', 'pr', 'create', '--organization', 'https://dev.azure.com/xpto', '--project', 'APIM-Mngt', '--source-branch', 'refs/heads/api-test-model', '--target-branch', 'refs/heads/dev', '--title', 'PR TEST', '--delete-source-branch', 'true', '--auto-complete', 'true', '--repository', 'apim-cd', '--optional-reviewers', 'felipe@hotmail.com', '--required-reviewers', 'felipe@hotmail.com', 'admin@xpto.dev.br', '--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 0x000002095747B7E0>, <function OutputProducer.on_global_arguments at 0x0000020957606020>, <function CLIQuery.on_global_arguments at 0x0000020957633BA0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'repos': ['azext_devops']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: Total (0) 0.000 0 0
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: azure-devops 0.195 60 192 C:\Users\felipe.azure\cliextensions\azure-devops
cli.azure.cli.core: Total (1) 0.195 60 192
cli.azure.cli.core: Loaded 60 groups, 192 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : repos pr create
cli.azure.cli.core: Command table: repos pr create
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x000002095983FE20>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\felipe.azure\commands\2024-09-16.15-33-12.repos_pr_create.10132.log'.
az_command_data_logger: command args: repos pr create --organization {} --project {} --source-branch {} --target-branch {} --title {} --delete-source-branch {} --auto-complete {} --repository {} --optional-reviewers {} --required-reviewers {} {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x00000209598767A0>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x00000209598B8860>, <function register_cache_arguments..add_cache_arguments at 0x00000209598B89A0>, <function register_upcoming_breaking_change_info..update_breaking_change_info at 0x00000209598B8A40>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x00000209576060C0>, <function CLIQuery.handle_query_parameter at 0x0000020957633C40>, <function register_ids_argument..parse_ids_arguments at 0x00000209598B8900>, <function DevCommandsLoader.post_parse_args at 0x00000209598EB560>]
az_command_data_logger: extension name: azure-devops
az_command_data_logger: extension version: 1.0.1
cli.azext_devops.dev.common._credentials: Getting credential: azdevops-cli:https://dev.azure.com/xpto
keyring.backend: Loading KWallet
keyring.backend: Loading SecretService
keyring.backend: Loading Windows
win32ctypes.core.cffi: Loaded cffi backend
keyring.backend: Loading chainer
keyring.backend: Loading macOS
cli.azext_devops.dev.common.credential_store: Keyring backend : keyring.backends.Windows.WinVaultKeyring (priority: 5)
cli.azext_devops.dev.common._credentials: Getting credential: azdevops-cli: default
cli.azext_devops.dev.common.credential_store: Keyring backend : keyring.backends.Windows.WinVaultKeyring (priority: 5)
cli.azext_devops.dev.common.services: PAT is present which can be used against this instance
cli.azure.cli.core: Current cloud config:
AzureCloud
cli.azext_devops.dev.common.services: trying to get token (temp) for tenant 5ec0b457-334c-4d27-91b0-d2a38b330948 and user felipe@hotmail.com
cli.azure.cli.core.auth.persistence: build_persistence: location='C:\Users\felipe\.azure\msal_token_cache.bin', encrypt=True
cli.azure.cli.core.auth.binary_cache: load: C:\Users\felipe.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: Initializing with Entra authority: https://login.microsoftonline.com/5ec0b457-334c-4d27-91b0-d2a38b330948
msal.authority: openid_config("https://login.microsoftonline.com/5ec0b457-334c-4d27-91b0-d2a38b330948/v2.0/.well-known/openid-configuration") = {'token_endpoint': 'https://login.microsoftonline.com/5ec0b457-334c-4d27-91b0-d2a38b330948/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/5ec0b457-334c-4d27-91b0-d2a38b330948/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/5ec0b457-334c-4d27-91b0-d2a38b330948/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/5ec0b457-334c-4d27-91b0-d2a38b330948/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/5ec0b457-334c-4d27-91b0-d2a38b330948/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/5ec0b457-334c-4d27-91b0-d2a38b330948/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/5ec0b457-334c-4d27-91b0-d2a38b330948/kerberos', 'tenant_region_scope': 'SA', '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? None
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('499b84ac-1321-427f-aa17-267ca6975798/.default',), claims=None, kwargs={}
msal.application: Cache hit an AT
msal.telemetry: Generate or reuse correlation_id: f6b71198-6343-4360-89af-9775722951a9
cli.azext_devops.dev.common.services: instance recieved in validate_token_for_instance https://dev.azure.com/xpto
cli.azext_devops.dev.common.services: instance processed in validate_token_for_instance https://dev.azure.com/xpto
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk._file_cache: Loading cache file: C:\Users\felipe.azure-devops\python-sdk\cache\resources.json
azext_devops.devops_sdk._file_cache: attempting to read file C:\Users\felipe.azure-devops\python-sdk\cache\resources.json as utf-8-sig
azext_devops.devops_sdk.connection: File cache hit for resources on: https://dev.azure.com/xpto
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk._file_cache: Loading cache file: C:\Users\felipe.azure-devops\python-sdk\cache\options.json
azext_devops.devops_sdk._file_cache: attempting to read file C:\Users\felipe.azure-devops\python-sdk\cache\options.json as utf-8-sig
azext_devops.devops_sdk.client: File cache hit for options on: https://dev.azure.com/xpto
azext_devops.devops_sdk.client: Route template: _apis/{resource}/{*projectId}
azext_devops.devops_sdk.client: Api version '5.0'
azext_devops.devops_sdk.client: GET https://dev.azure.com/xpto/_apis/projects?stateFilter=all&$top=1&$skip=0
azext_devops.devops_sdk.client: Request content: None
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: Starting new HTTPS connection (1): dev.azure.com:443
urllib3.connectionpool: https://dev.azure.com:443 "GET /felipe/_apis/projects?stateFilter=all&$top=1&$skip=0 HTTP/1.1" 401 343
azext_devops.devops_sdk.client: Response content: b'{"$id":"1","innerException":null,"message":"TF400813: The user 'e6f55502-6e0e-4f20-9fbf-04b91511c53c' is not authorized to access this resource.","typeName":"Microsoft.TeamFoundation.Framework.Server.UnauthorizedRequestException, Microsoft.TeamFoundation.Framework.Server","typeKey":"UnauthorizedRequestException","errorCode":0,"eventId":3000}'
msrest.exceptions: TF400813: The user 'e6f55502-6e0e-4f20-9fbf-04b91511c53c' is not authorized to access this resource.
cli.azext_devops.dev.common.services: TF400813: The user 'e6f55502-6e0e-4f20-9fbf-04b91511c53c' is not authorized to access this resource.
Traceback (most recent call last):
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 93, in validate_token_for_instance
core_client.get_projects(state_filter='all', top=1, skip=0)
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\v5_0\core\core_client.py", line 140, in get_projects
response = self._send(http_method='GET',
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 90, in _send
response = self._send_request(request=request, headers=headers, content=content, media_type=media_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 54, in _send_request
self._handle_error(request, response)
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 233, in _handle_error
raise AzureDevOpsServiceError(wrapped_exception)
azext_devops.devops_sdk.exceptions.AzureDevOpsServiceError: TF400813: The user 'e6f55502-6e0e-4f20-9fbf-04b91511c53c' is not authorized to access this resource.
cli.azext_devops.dev.common.services: Failed to connect using provided credentials
cli.azext_devops.dev.common.services: invalid token obtained for tenant 5ec0b457-334c-4d27-91b0-d2a38b330948
cli.azext_devops.dev.common.services: trying to get token (temp) for tenant e79034b6-c14f-4d3e-a08f-d8d7d4643271 and user felipe.pimentel@prestadores.amil.com.br
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.authority: Initializing with Entra authority: https://login.microsoftonline.com/e79034b6-c14f-4d3e-a08f-d8d7d4643271
msal.authority: openid_config("https://login.microsoftonline.com/e79034b6-c14f-4d3e-a08f-d8d7d4643271/v2.0/.well-known/openid-configuration") = {'token_endpoint': 'https://login.microsoftonline.com/e79034b6-c14f-4d3e-a08f-d8d7d4643271/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/e79034b6-c14f-4d3e-a08f-d8d7d4643271/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/e79034b6-c14f-4d3e-a08f-d8d7d4643271/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/e79034b6-c14f-4d3e-a08f-d8d7d4643271/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/e79034b6-c14f-4d3e-a08f-d8d7d4643271/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/e79034b6-c14f-4d3e-a08f-d8d7d4643271/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/e79034b6-c14f-4d3e-a08f-d8d7d4643271/kerberos', 'tenant_region_scope': 'SA', '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? None
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('499b84ac-1321-427f-aa17-267ca6975798/.default',), claims=None, kwargs={}
msal.application: Found 1 RTs matching {'environment': 'login.microsoftonline.com', 'home_account_id': '.9188040d-6c67-4c5b-b112-36a304b66dad', 'family_id': '1'}
msal.telemetry: Generate or reuse correlation_id: 49c42099-3cde-4057-84bb-386ec086f575
msal.application: Cache attempts an RT
cli.azure.cli.core.auth.binary_cache: save: C:\Users\felipe.azure\msal_http_cache.bin
cli.azure.cli.core.auth.binary_cache: save: C:\Users\felipe.azure\msal_http_cache.bin
urllib3.connectionpool: Starting new HTTPS connection (1): login.microsoftonline.com:443
urllib3.connectionpool: https://login.microsoftonline.com:443 "POST /e79034b6-c14f-4d3e-a08f-d8d7d4643271/oauth2/v2.0/token HTTP/1.1" 400 595
cli.azure.cli.core.auth.binary_cache: save: C:\Users\felipe.azure\msal_http_cache.bin
cli.azure.cli.core.auth.binary_cache: save: C:\Users\felipe.azure\msal_http_cache.bin
msal.application: Refresh failed. invalid_grant: AADSTS70043: The refresh token has expired or is invalid due to sign-in frequency checks by conditional access. The token was issued on 2024-08-08T15:01:30.6210240Z and the maximum allowed lifetime for this request is 604800. Trace ID: 9e03d90c-a291-4dec-8aed-5cace8af6300 Correlation ID: 49c42099-3cde-4057-84bb-386ec086f575 Timestamp: 2024-09-16 18:35:15Z
msal.application: Found 1 RTs matching {'environment': 'login.microsoftonline.com', 'home_account_id': '.9188040d-6c67-4c5b-b112-36a304b66dad', 'client_id': '04b07795-8ddb-461a-bbee-02f9e1bf7b46'}
msal.telemetry: Generate or reuse correlation_id: 49c42099-3cde-4057-84bb-386ec086f575
msal.application: Cache attempts an RT
msal.application: Refresh failed. invalid_grant: AADSTS70043: The refresh token has expired or is invalid due to sign-in frequency checks by conditional access. The token was issued on 2024-08-08T15:01:30.6210240Z and the maximum allowed lifetime for this request is 604800. Trace ID: 9e03d90c-a291-4dec-8aed-5cace8af6300 Correlation ID: 49c42099-3cde-4057-84bb-386ec086f575 Timestamp: 2024-09-16 18:35:15Z
cli.azext_devops.dev.common.services: not able to get token from az login
cli.azext_devops.dev.common.services: AADSTS70043: The refresh token has expired or is invalid due to sign-in frequency checks by conditional access. The token was issued on 2024-08-08T15:01:30.6210240Z and the maximum allowed lifetime for this request is 604800. Trace ID: 9e03d90c-a291-4dec-8aed-5cace8af6300 Correlation ID: 49c42099-3cde-4057-84bb-386ec086f575 Timestamp: 2024-09-16 18:35:15Z
Traceback (most recent call last):
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 157, in get_token_from_az_login
raw = profile.get_raw_token(
^^^^^^^^^^^^^^^^^^^^^^
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/_profile.py", line 415, in get_raw_token
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/auth/msal_authentication.py", line 74, in get_token
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/auth/util.py", line 139, in check_result
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/auth/util.py", line 43, in aad_error_handler
azure.cli.core.azclierror.AuthenticationError: AADSTS70043: The refresh token has expired or is invalid due to sign-in frequency checks by conditional access. The token was issued on 2024-08-08T15:01:30.6210240Z and the maximum allowed lifetime for this request is 604800. Trace ID: 9e03d90c-a291-4dec-8aed-5cace8af6300 Correlation ID: 49c42099-3cde-4057-84bb-386ec086f575 Timestamp: 2024-09-16 18:35:15Z
cli.azext_devops.dev.common.services: instance recieved in validate_token_for_instance https://dev.azure.com/xpto
cli.azext_devops.dev.common.services: instance processed in validate_token_for_instance https://dev.azure.com/xpto
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk.connection: File cache hit for resources on: https://dev.azure.com/xpto
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk.client: Route template: _apis/{resource}/{*projectId}
azext_devops.devops_sdk.client: Api version '5.0'
azext_devops.devops_sdk.client: GET https://dev.azure.com/xpto/_apis/projects?stateFilter=all&$top=1&$skip=0
azext_devops.devops_sdk.client: Request content: None
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: Starting new HTTPS connection (1): dev.azure.com:443
urllib3.connectionpool: https://dev.azure.com:443 "GET /felipe/_apis/projects?stateFilter=all&$top=1&$skip=0 HTTP/1.1" 401 343
azext_devops.devops_sdk.client: Response content: b'{"$id":"1","innerException":null,"message":"TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.","typeName":"Microsoft.TeamFoundation.Framework.Server.UnauthorizedRequestException, Microsoft.TeamFoundation.Framework.Server","typeKey":"UnauthorizedRequestException","errorCode":0,"eventId":3000}'
msrest.exceptions: TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.
cli.azext_devops.dev.common.services: TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.
Traceback (most recent call last):
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 93, in validate_token_for_instance
core_client.get_projects(state_filter='all', top=1, skip=0)
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\v5_0\core\core_client.py", line 140, in get_projects
response = self._send(http_method='GET',
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 90, in _send
response = self._send_request(request=request, headers=headers, content=content, media_type=media_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 54, in _send_request
self._handle_error(request, response)
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 233, in _handle_error
raise AzureDevOpsServiceError(wrapped_exception)
azext_devops.devops_sdk.exceptions.AzureDevOpsServiceError: TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.
cli.azext_devops.dev.common.services: Failed to connect using provided credentials
cli.azext_devops.dev.common.services: invalid token obtained for tenant e79034b6-c14f-4d3e-a08f-d8d7d4643271
cli.azext_devops.dev.common.services: trying to get token (temp) for tenant 6d23e42b-81f3-43f2-9d7d-19031a23c3f2 and user felipe@avanade.com
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.authority: Initializing with Entra authority: https://login.microsoftonline.com/6d23e42b-81f3-43f2-9d7d-19031a23c3f2
msal.authority: openid_config("https://login.microsoftonline.com/6d23e42b-81f3-43f2-9d7d-19031a23c3f2/v2.0/.well-known/openid-configuration") = {'token_endpoint': 'https://login.microsoftonline.com/6d23e42b-81f3-43f2-9d7d-19031a23c3f2/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/6d23e42b-81f3-43f2-9d7d-19031a23c3f2/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/6d23e42b-81f3-43f2-9d7d-19031a23c3f2/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/6d23e42b-81f3-43f2-9d7d-19031a23c3f2/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/6d23e42b-81f3-43f2-9d7d-19031a23c3f2/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/6d23e42b-81f3-43f2-9d7d-19031a23c3f2/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/6d23e42b-81f3-43f2-9d7d-19031a23c3f2/kerberos', 'tenant_region_scope': 'SA', '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? None
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('499b84ac-1321-427f-aa17-267ca6975798/.default',), claims=None, kwargs={}
msal.application: Cache hit an AT
msal.telemetry: Generate or reuse correlation_id: d684827e-1b99-450a-a887-42ac957a8647
cli.azext_devops.dev.common.services: instance recieved in validate_token_for_instance https://dev.azure.com/xpto
cli.azext_devops.dev.common.services: instance processed in validate_token_for_instance https://dev.azure.com/xpto
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk.connection: File cache hit for resources on: https://dev.azure.com/xpto
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk.client: Route template: _apis/{resource}/{*projectId}
azext_devops.devops_sdk.client: Api version '5.0'
azext_devops.devops_sdk.client: GET https://dev.azure.com/xpto/_apis/projects?stateFilter=all&$top=1&$skip=0
azext_devops.devops_sdk.client: Request content: None
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: Starting new HTTPS connection (1): dev.azure.com:443
urllib3.connectionpool: https://dev.azure.com:443 "GET /felipe/_apis/projects?stateFilter=all&$top=1&$skip=0 HTTP/1.1" 401 343
azext_devops.devops_sdk.client: Response content: b'{"$id":"1","innerException":null,"message":"TF400813: The user 'e6f55502-6e0e-4f20-9fbf-04b91511c53c' is not authorized to access this resource.","typeName":"Microsoft.TeamFoundation.Framework.Server.UnauthorizedRequestException, Microsoft.TeamFoundation.Framework.Server","typeKey":"UnauthorizedRequestException","errorCode":0,"eventId":3000}'
msrest.exceptions: TF400813: The user 'e6f55502-6e0e-4f20-9fbf-04b91511c53c' is not authorized to access this resource.
cli.azext_devops.dev.common.services: TF400813: The user 'e6f55502-6e0e-4f20-9fbf-04b91511c53c' is not authorized to access this resource.
Traceback (most recent call last):
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\dev\common\services.py", line 93, in validate_token_for_instance
core_client.get_projects(state_filter='all', top=1, skip=0)
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\v5_0\core\core_client.py", line 140, in get_projects
response = self._send(http_method='GET',
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 90, in _send
response = self._send_request(request=request, headers=headers, content=content, media_type=media_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 54, in _send_request
self._handle_error(request, response)
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 233, in _handle_error
raise AzureDevOpsServiceError(wrapped_exception)
azext_devops.devops_sdk.exceptions.AzureDevOpsServiceError: TF400813: The user 'e6f55502-6e0e-4f20-9fbf-04b91511c53c' is not authorized to access this resource.
cli.azext_devops.dev.common.services: Failed to connect using provided credentials
cli.azext_devops.dev.common.services: invalid token obtained for tenant 6d23e42b-81f3-43f2-9d7d-19031a23c3f2
cli.azext_devops.dev.common._credentials: Getting credential: azdevops-cli:https://dev.azure.com/xpto
cli.azext_devops.dev.common.credential_store: Keyring backend : keyring.backends.Windows.WinVaultKeyring (priority: 5)
cli.azext_devops.dev.common._credentials: Getting credential: azdevops-cli: default
cli.azext_devops.dev.common.credential_store: Keyring backend : keyring.backends.Windows.WinVaultKeyring (priority: 5)
cli.azext_devops.dev.common.services: Creating connection with personal access token.
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
cli.azext_devops.dev.common.telemetry: Azure devops telemetry enabled.
cli.azext_devops.dev.common.telemetry: Logging telemetry to azure devops server.
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk.client: Route template: _apis/{area}/{resource}
azext_devops.devops_sdk.connection: File cache hit for resources on: https://dev.azure.com/xpto
azext_devops.devops_sdk.client: Api version '5.0-preview.1'
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk.client: POST https://dev.azure.com/xpto/_apis/CustomerIntelligence/Events
azext_devops.devops_sdk.client: Request content: [{'area': 'AzureDevopsCli', 'feature': 'repos', 'properties': {'Command': 'pr create', 'Args': 'project repository source_branch target_branch title organization', 'ShellType': 'cmd', 'IsInteractive': 'True', 'OutputType': 'json', 'OrgPresentInCommand': True, 'ProjectPresentInCommand': True, 'RepoPresentInCommand': True}}]
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: Starting new HTTPS connection (1): dev.azure.com:443
msrest.universal_http.requests: Configuring retry: max_retries=3, backoff_factor=0.8, max_backoff=90
azext_devops.devops_sdk.client: File cache hit for options on: https://vssps.dev.azure.com/felipe
azext_devops.devops_sdk.client: Route template: _apis/{resource}/{identityId}
azext_devops.devops_sdk.client: Api version '5.0'
azext_devops.devops_sdk.client: GET https://vssps.dev.azure.com/felipe/_apis/Identities?searchFilter=General&filterValue=felipe%40hotmail.com
azext_devops.devops_sdk.client: Request content: None
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: Starting new HTTPS connection (1): vssps.dev.azure.com:443
urllib3.connectionpool: https://dev.azure.com:443 "POST /felipe/_apis/CustomerIntelligence/Events HTTP/1.1" 204 0
urllib3.connectionpool: https://vssps.dev.azure.com:443 "GET /felipe/_apis/Identities?searchFilter=General&filterValue=felipe%40hotmail.com HTTP/1.1" 200 795
azext_devops.devops_sdk.client: Response content: b'{"count":1,"value":[{"id":"e6f55502-6e0e-4f20-9fbf-04b91511c53c","descriptor":"Microsoft.IdentityModel.Claims.ClaimsIdentity;5ec0b457-334c-4d27-91b0-d2a38b330948\\felipe@hotmail.com","subjectDescriptor":"aad.MDdiNDY1ZDEtYjA4Mi03OGQzLWFiYWQtNTM0YTE5Y2UyNmVk","providerDisplayName":"Felipe Pimentel Augusto","customDisplayName":"Felipe Augusto","isActive":true,"members":[],"memberOf":[],"memberIds":[],"properties":{"SchemaClassName":{"$type":"System.String","$value":"User"},"Description":{"$type":"System.String","$value":""},"Domain":{"$type":"System.String","$value":"5ec0b457-334c-4d27-91b0-d2a38b330948"},"Account":{"$type":"System.String","$value":"felipe@hotmail.com"},"DN":{"$type":"System.String","$value":""},"Mail":{"$type":"System.String","$value":"felipe@hotmail.com"},"SpecialType":{"$type":"System.String","$value":"Generic"},"PUID":{"$type":"System.String","$value":"00018101A5C4C2E6"},"ComplianceValidated":{"$type":"System.DateTime","$value":"2024-09-16T00:00:00Z"},"http://schemas.microsoft.com/identity/claims/objectidentifier":{"$type":"System.String","$value":"22d60549-e51e-431f-a9fa-6819b3066d41"},"MetadataUpdateDate":{"$type":"System.DateTime","$value":"2021-02-24T01:55:21Z"},"DirectoryAlias":{"$type":"System.String","$value":"felipe_hotmail.com#EXT#"}},"resourceVersion":2,"metaTypeId":0}]}'
azext_devops.devops_sdk.client: Route template: _apis/{resource}/{identityId}
azext_devops.devops_sdk.client: Api version '5.0'
azext_devops.devops_sdk.client: GET https://vssps.dev.azure.com/felipe/_apis/Identities?searchFilter=General&filterValue=admin%40felipe.dev.br
azext_devops.devops_sdk.client: Request content: None
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: https://vssps.dev.azure.com:443 "GET /felipe/_apis/Identities?searchFilter=General&filterValue=admin%40felipe.dev.br HTTP/1.1" 200 776
azext_devops.devops_sdk.client: Response content: b'{"count":1,"value":[{"id":"a0032193-ac98-606f-85b2-75c1bf4308f7","descriptor":"Microsoft.IdentityModel.Claims.ClaimsIdentity;5ec0b457-334c-4d27-91b0-d2a38b330948\\admin@felipe.dev.br","subjectDescriptor":"aad.YTAwMzIxOTMtYWM5OC03MDZmLTg1YjItNzVjMWJmNDMwOGY3","providerDisplayName":"Felipe Augusto","isActive":true,"members":[],"memberOf":[],"memberIds":[],"properties":{"SchemaClassName":{"$type":"System.String","$value":"User"},"Description":{"$type":"System.String","$value":""},"Domain":{"$type":"System.String","$value":"5ec0b457-334c-4d27-91b0-d2a38b330948"},"Account":{"$type":"System.String","$value":"admin@felipe.dev.br"},"DN":{"$type":"System.String","$value":""},"Mail":{"$type":"System.String","$value":"admin@felipe.dev.br"},"SpecialType":{"$type":"System.String","$value":"Generic"},"PUID":{"$type":"System.String","$value":"aad:100320010A3638A9"},"ComplianceValidated":{"$type":"System.DateTime","$value":"2024-09-16T00:00:00Z"},"http://schemas.microsoft.com/identity/claims/objectidentifier":{"$type":"System.String","$value":"1919af9d-fb1f-4bfc-b042-68a851076501"},"MetadataUpdateDate":{"$type":"System.DateTime","$value":"2024-09-13T21:38:28Z"},"DirectoryAlias":{"$type":"System.String","$value":"userfelipe"}},"resourceVersion":2,"metaTypeId":0}]}'
azext_devops.devops_sdk.client: Route template: _apis/{resource}/{identityId}
azext_devops.devops_sdk.client: Api version '5.0'
azext_devops.devops_sdk.client: GET https://vssps.dev.azure.com/felipe/_apis/Identities?searchFilter=General&filterValue=felipe%40hotmail.com
azext_devops.devops_sdk.client: Request content: None
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: https://vssps.dev.azure.com:443 "GET /felipe/_apis/Identities?searchFilter=General&filterValue=felipe%40hotmail.com HTTP/1.1" 200 795
azext_devops.devops_sdk.client: Response content: b'{"count":1,"value":[{"id":"e6f55502-6e0e-4f20-9fbf-04b91511c53c","descriptor":"Microsoft.IdentityModel.Claims.ClaimsIdentity;5ec0b457-334c-4d27-91b0-d2a38b330948\\felipe@hotmail.com","subjectDescriptor":"aad.MDdiNDY1ZDEtYjA4Mi03OGQzLWFiYWQtNTM0YTE5Y2UyNmVk","providerDisplayName":"Felipe Pimentel Augusto","customDisplayName":"Felipe Augusto","isActive":true,"members":[],"memberOf":[],"memberIds":[],"properties":{"SchemaClassName":{"$type":"System.String","$value":"User"},"Description":{"$type":"System.String","$value":""},"Domain":{"$type":"System.String","$value":"5ec0b457-334c-4d27-91b0-d2a38b330948"},"Account":{"$type":"System.String","$value":"felipe@hotmail.com"},"DN":{"$type":"System.String","$value":""},"Mail":{"$type":"System.String","$value":"felipe@hotmail.com"},"SpecialType":{"$type":"System.String","$value":"Generic"},"PUID":{"$type":"System.String","$value":"00018101A5C4C2E6"},"ComplianceValidated":{"$type":"System.DateTime","$value":"2024-09-16T00:00:00Z"},"http://schemas.microsoft.com/identity/claims/objectidentifier":{"$type":"System.String","$value":"22d60549-e51e-431f-a9fa-6819b3066d41"},"MetadataUpdateDate":{"$type":"System.DateTime","$value":"2021-02-24T01:55:21Z"},"DirectoryAlias":{"$type":"System.String","$value":"felipe_hotmail.com#EXT#"}},"resourceVersion":2,"metaTypeId":0}]}'
azext_devops.devops_sdk.client: Route template: {project}/_apis/{area}/repositories/{repositoryId}/{resource}/{pullRequestId}
azext_devops.devops_sdk.client: Api version '5.0'
azext_devops.devops_sdk.client: POST https://dev.azure.com/xpto/APIM-Mngt/_apis/git/repositories/apim-cd/pullRequests
azext_devops.devops_sdk.client: Request content: {'reviewers': [{'id': 'e6f55502-6e0e-4f20-9fbf-04b91511c53c', 'isRequired': True}, {'id': 'a0032193-ac98-606f-85b2-75c1bf4308f7', 'isRequired': True}, {'id': 'e6f55502-6e0e-4f20-9fbf-04b91511c53c', 'isRequired': True}], 'sourceRefName': 'refs/heads/api-test-model', 'targetRefName': 'refs/heads/dev', 'title': 'PR TEST'}
msrest.universal_http: Configuring redirects: allow=True, max=30
msrest.universal_http: Configuring request: timeout=100, verify=True, cert=None
msrest.universal_http: Configuring proxies: ''
msrest.universal_http: Evaluate proxies against ENV settings: True
urllib3.connectionpool: Starting new HTTPS connection (1): dev.azure.com:443
urllib3.connectionpool: https://dev.azure.com:443 "POST /felipe/APIM-Mngt/_apis/git/repositories/apim-cd/pullRequests HTTP/1.1" 409 314
azext_devops.devops_sdk.client: Response content: b'{"$id":"1","innerException":null,"message":"TF401179: An active pull request for the source and target branch already exists.","typeName":"Microsoft.TeamFoundation.Git.Server.GitPullRequestExistsException, Microsoft.TeamFoundation.Git.Server","typeKey":"GitPullRequestExistsException","errorCode":0,"eventId":3000}'
msrest.exceptions: TF401179: An active pull request for the source and target branch already exists.
cli.azext_devops.dev.common.exception_handler: handling vsts service error
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 703, in _run_job
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 336, in call
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\dev\repos\pull_request.py", line 200, in create_pull_request
pr = client.create_pull_request(git_pull_request_to_create=pr, project=project,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\v5_0\git\git_client_base.py", line 1382, in create_pull_request
response = self._send(http_method='POST',
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 90, in _send
response = self._send_request(request=request, headers=headers, content=content, media_type=media_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 54, in _send_request
self._handle_error(request, response)
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\devops_sdk\client.py", line 233, in _handle_error
raise AzureDevOpsServiceError(wrapped_exception)
azext_devops.devops_sdk.exceptions.AzureDevOpsServiceError: TF401179: An active pull request for the source and target branch already exists.
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\knack/cli.py", line 233, in invoke
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 666, in execute
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 733, in _run_jobs_serially
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 725, in _run_job
File "C:\Users\felipe.azure\cliextensions\azure-devops\azext_devops\dev\common\exception_handler.py", line 18, in azure_devops_exception_handler
raise CLIError(ex)
knack.util.CLIError: TF401179: An active pull request for the source and target branch already exists.
cli.azure.cli.core.azclierror: TF401179: An active pull request for the source and target branch already exists.
az_command_data_logger: TF401179: An active pull request for the source and target branch already exists.
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x00000209598400E0>]
az_command_data_logger: exit code: 1
cli.main: Command ran in 5.385 seconds (init: 0.508, invoke: 4.877)
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 3958 in cache file under C:\Users\felipe.azure\telemetry\20240916153316987
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\felipe.azure C:\Users\felipe.azure\telemetry\20240916153316987"
telemetry.process: Return from creating process 4840
telemetry.main: Finish creating telemetry upload process.
Expected behavior
The expected result is the creation of the PR, as in the example below
{
"artifactId": "vstfs:///Git/PullRequestId/2d2f83bc-xxx%2f9feb1e01-bb94-xxx%2f176",
"autoCompleteSetBy": {
"descriptor": "aad.MDdiNDY1ZDEtYjA4Mi03OGQzLWFiYWQtNTM0YTE5Y2UyNmVk",
"directoryAlias": null,
"displayName": "Felipe Augusto",
"id": "e6f55502-xxx",
"imageUrl": "https://dev.azure.com/xpto/_api/_common/identityImage?id=e6f55502-xxx",
"inactive": null,
"isAadIdentity": null,
"isContainer": null,
"isDeletedInOrigin": null,
"profileUrl": null,
"uniqueName": "felipe@hotmail.com",
"url": "https://spsprodeus21.vssps.visualstudio.com/A97723661-xxx/_apis/Identities/e6f55502-xxx"
},
"closedBy": null,
"closedDate": null,
"codeReviewId": 176,
"commits": null,
"completionOptions": {
"bypassPolicy": null,
"bypassReason": null,
"deleteSourceBranch": true,
"mergeCommitMessage": null,
"mergeStrategy": "noFastForward",
"squashMerge": null,
"transitionWorkItems": null,
"triggeredByAutoComplete": null
},
"completionQueueTime": null,
"createdBy": {
"descriptor": "aad.MDdiNDY1ZDEtYjA4Mi03OGQzLWFiYWQtNTM0YTE5Y2UyNmVk",
"directoryAlias": null,
"displayName": "Felipe Augusto",
"id": "e6f55502-xxx",
"imageUrl": "https://dev.azure.com/xpto/_api/_common/identityImage?id=e6f55502-xxx",
"inactive": null,
"isAadIdentity": null,
"isContainer": null,
"isDeletedInOrigin": null,
"profileUrl": null,
"uniqueName": "felipe@hotmail.com",
"url": "https://spsprodeus21.vssps.visualstudio.com/A97723661-xxx/_apis/Identities/e6f55502-xxx"
},
"creationDate": "2024-09-16T18:28:58.941424+00:00",
"description": null,
"forkSource": null,
"isDraft": false,
"labels": null,
"lastMergeCommit": {
"author": {
"date": "2024-09-14T12:35:29+00:00",
"email": "Project Collection Build Service (felipementel)",
"imageUrl": null,
"name": "Project Collection Build Service (felipementel)"
},
"changeCounts": null,
"changes": null,
"comment": "Merge pull request 167 from api-teste_678_Build_202409.97 into dev",
"commentTruncated": null,
"commitId": "838bbc4fc7db014a021d3127a44de8b82483be37",
"committer": {
"date": "2024-09-14T12:35:29+00:00",
"email": "Project Collection Build Service (felipementel)",
"imageUrl": null,
"name": "Project Collection Build Service (felipementel)"
},
"parents": null,
"push": null,
"remoteUrl": null,
"statuses": null,
"url": "https://dev.azure.com/xpto/2d2f83bc-xxx/_apis/git/repositories/9feb1e01-bb94-xxx/commits/838bbc4fc7db014a021d3127a44de8b82483be37",
"workItems": null
},
"lastMergeSourceCommit": {
"author": null,
"changeCounts": null,
"changes": null,
"comment": null,
"commentTruncated": null,
"commitId": "3ece34635105d3e8992e73dcc0e347e533ee2535",
"committer": null,
"parents": null,
"push": null,
"remoteUrl": null,
"statuses": null,
"url": "https://dev.azure.com/xpto/2d2f83bc-xxx/_apis/git/repositories/9feb1e01-bb94-xxx/commits/3ece34635105d3e8992e73dcc0e347e533ee2535",
"workItems": null
},
"lastMergeTargetCommit": {
"author": null,
"changeCounts": null,
"changes": null,
"comment": null,
"commentTruncated": null,
"commitId": "838bbc4fc7db014a021d3127a44de8b82483be37",
"committer": null,
"parents": null,
"push": null,
"remoteUrl": null,
"statuses": null,
"url": "https://dev.azure.com/xpto/2d2f83bc-xxx/_apis/git/repositories/9feb1e01-bb94-xxx/commits/838bbc4fc7db014a021d3127a44de8b82483be37",
"workItems": null
},
"mergeFailureMessage": null,
"mergeFailureType": null,
"mergeId": "8a352d1f-894c-4771-aaa1-b5403ca49514",
"mergeOptions": null,
"mergeStatus": "succeeded",
"pullRequestId": 176,
"remoteUrl": null,
"repository": {
"defaultBranch": null,
"id": "9feb1e01-bb94-xxx",
"isDisabled": false,
"isFork": null,
"isInMaintenance": false,
"name": "apim-cd",
"parentRepository": null,
"project": {
"abbreviation": null,
"defaultTeamImageUrl": null,
"description": null,
"id": "2d2f83bc-xxx",
"lastUpdateTime": "2024-09-07T01:52:08.683Z",
"name": "APIM-Mngt",
"revision": 425900918,
"state": "wellFormed",
"url": "https://dev.azure.com/xpto/_apis/projects/2d2f83bc-xxx",
"visibility": "private"
},
"remoteUrl": "https://xpto@dev.azure.com/xpto/APIM-Mngt/_git/apim-cd",
"size": 462711,
"sshUrl": "git@ssh.dev.azure.com:v3/felipementel/APIM-Mngt/apim-cd",
"url": "https://dev.azure.com/xpto/2d2f83bc-xxx/_apis/git/repositories/9feb1e01-bb94-xxx",
"validRemoteUrls": null,
"webUrl": "https://dev.azure.com/xpto/APIM-Mngt/_git/apim-cd"
},
"reviewers": [
{
"descriptor": null,
"directoryAlias": null,
"displayName": "Felipe Augusto",
"hasDeclined": false,
"id": "e6f55502-xxx",
"imageUrl": "https://dev.azure.com/xpto/_api/_common/identityImage?id=e6f55502-xxx",
"inactive": null,
"isAadIdentity": null,
"isContainer": null,
"isDeletedInOrigin": null,
"isFlagged": false,
"isRequired": null,
"profileUrl": null,
"reviewerUrl": "https://dev.azure.com/xpto/2d2f83bc-xxx/_apis/git/repositories/9feb1e01-bb94-xxx/pullRequests/176/reviewers/e6f55502-xxx",
"uniqueName": "felipe@hotmail.com",
"url": "https://spsprodeus21.vssps.visualstudio.com/A97723661-xxx/_apis/Identities/e6f55502-xxx",
"vote": 0,
"votedFor": null
},
{
"descriptor": null,
"directoryAlias": null,
"displayName": "Felipe Augusto",
"hasDeclined": false,
"id": "a0032193-ac98-606f-85b2-75c1bf4308f7",
"imageUrl": "https://dev.azure.com/xpto/_api/_common/identityImage?id=a0032193-ac98-606f-85b2-75c1bf4308f7",
"inactive": null,
"isAadIdentity": null,
"isContainer": null,
"isDeletedInOrigin": null,
"isFlagged": false,
"isRequired": true,
"profileUrl": null,
"reviewerUrl": "https://dev.azure.com/xpto/2d2f83bc-xxx/_apis/git/repositories/9feb1e01-bb94-xxx/pullRequests/176/reviewers/a0032193-ac98-606f-85b2-75c1bf4308f7",
"uniqueName": "admin@felipementel.dev.br",
"url": "https://spsprodeus21.vssps.visualstudio.com/A97723661-xxx/_apis/Identities/a0032193-ac98-606f-85b2-75c1bf4308f7",
"vote": 0,
"votedFor": null
}
],
"sourceRefName": "refs/heads/api-test-model",
"status": "active",
"supportsIterations": true,
"targetRefName": "refs/heads/dev",
"title": "PR TEST",
"url": "https://dev.azure.com/xpto/2d2f83bc-xxx/_apis/git/repositories/9feb1e01-bb94-xxx/pullRequests/176",
"workItemRefs": null
}
Environment Summary
➜ az --version
azure-cli 2.64.0
core 2.64.0
telemetry 1.1.0
Extensions:
azure-devops 1.0.1
resource-graph 2.1.0
Dependencies:
msal 1.30.0
azure-mgmt-resource 23.1.1
Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\xxxxxxx.azure\cliextensions'
Python (Windows) 3.11.8 (tags/v3.11.8:db85d51, Feb 6 2024, 22:03:32) [MSC v.1937 64 bit (AMD64)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
This issue is impacting our production environment.