Azure / Azure/azure-devops-cli-extension

"Could not resolve identity" when required reviewers is distribution list

Open
#1,013 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
682
Forks
278
Avg merge
3d 23h
Merged PRs (30d)
3

Description

## Describe the bug
When trying to create a branch policy with required reviewers:

$ az repos policy required-reviewer create ... --required-reviewer-ids xyz@abc.com

fails with

Could not resolve identity: xyz@abc.com

The email-address (placeholder above) is a **distribution list** in Outlook containing 12 email addresses. If I re-run the command with a regular email address the command works OK.

**Command Name**
`az repos policy required-reviewer create

Extension Name: azure-devops. Version: 0.17.0.`

**Errors:**
```
Could not resolve identity: xyz@abc.com
```
## To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

- organisation, project, repo, branch must exist and you must have the required access rights.
- `az repos policy required-reviewer create --project {} --repository-id {} --branch {} --enabled true --blocking true --message "please review this" --required-reviewer-ids xyz@abc.com`

## Expected Behavior
A JSON object that describes the new policy is returned. No errors.

## Environment Summary
```
Linux-5.3.0-51-generic-x86_64-with-debian-buster-sid
Python 3.6.5
Installer: DEB

azure-cli 2.6.0 *

Extensions:
azure-devops 0.17.0

```
## Additional Context

Reading from [these docs]( https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/repos/policy/required-reviewer?view=azure-cli-latest#ext-azure-devops-az-repos-policy-required-reviewer-create) . I have used the regular email address (at-format) of the distribution list, not the Pretty Long Name

Running with `-debug` shows that nothing is returned on lookup of email-address:
```
...
urllib3.connectionpool : https://vssps.dev.azure.com:443 "GET /FOO/_apis/Identities?searchFilter=General&filterValue=xyz%40abc.com HTTP/1.1" 200 143
azext_devops.devops_sdk.client : Response content: b'{"count":0,"value":[]}'
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/FOO/_apis/Identities?searchFilter=DirectoryAlias&filterValue=xyz%40abc.com
azext_devops.devops_sdk.client : Request content: None
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.