codeant-ai-bot, whose personal access token CodeAnt uses to read repositories and post reviews. Use it when you want automated activity attributed to a separate account and managed independently of a developer’s membership.
To connect Azure DevOps Services without a user PAT, use Microsoft Entra workload identity.
Before you begin
- A dedicated Microsoft Entra user with a company email address. Ask your identity administrator to create it if it does not exist.
- An Azure DevOps administrator who can add users and assign project access.
- Permission for the dedicated user to create PATs under your organization’s policy.
- The projects and repositories CodeAnt should access.
Create the account and token
1
Add the dedicated user to Azure DevOps
Open the Azure DevOps organization and go to Organization settings → Users → Add users.Enter the dedicated user’s email address. Set Access level to Basic, select the projects CodeAnt should access, and add the user. Follow Microsoft’s user management guide if you need help assigning access.
2
Check repository permissions
In each selected project, open Project settings → Repositories → Security and select the dedicated user. Confirm that the account has Read and Contribute to pull requests access, with no inherited or explicit Deny blocking them.Contribute to pull requests allows review activity. Contribute is a separate permission for pushing code; grant it only if you want CodeAnt to perform code writes. See Microsoft’s repository permission definitions.
3
Create the PAT as the dedicated user
Sign in to Azure DevOps as the dedicated user. Open User settings → Personal access tokens and select + New Token.Name the token
CodeAnt AI, select the intended organization, and choose an expiry date permitted by your policy. Select these scopes:Code and Pull Request Threads are the scopes for scans and reviews. Add Build for DORA metrics and Work Items for work item data and Azure DevOps ticket creation.Select Create and copy the token before leaving the page. The PAT inherits the dedicated user’s access; scopes do not grant access to projects the user cannot reach.
Connect and verify the account
- Use the dedicated user’s PAT in the CodeAnt organization connection.
- Use the same PAT in both subscriptions from the pull request review setup.
- Confirm that an expected repository appears in CodeAnt.
- Open a new PR in that repository and check that CodeAnt’s review comments are attributed to the dedicated account.
Replace the token before it expires
- Sign in as the dedicated user and create a new PAT with the same scopes.
- Update the saved token in CodeAnt and in both CodeAnt service hook subscriptions.
- Request a review and confirm that it succeeds.
- Revoke the old PAT in Azure DevOps.
Troubleshooting
The account cannot see the repository
The account cannot see the repository
Check its Basic access level, project membership, and repository Read permission. Check inherited Deny settings as well as the permissions assigned directly to the user.
The account can read code but cannot post reviews
The account can read code but cannot post reviews
Confirm Contribute to pull requests access and the PAT’s Pull Request Threads: Read & write scope. Check that both service hook subscriptions use this PAT. If review posting still fails, contact CodeAnt support with the project and PR URL. Do not include the token.
New comments still show a developer's name
New comments still show a developer's name
Confirm that the PAT was created while signed in as the dedicated user, then update both service hooks and the saved CodeAnt connection. Open a new PR to verify the author; existing comments do not change attribution.
Next steps
Connect your organization
Save the dedicated user’s PAT and verify repository access.
Enable pull request reviews
Configure the project service hooks with the dedicated user’s PAT.