Hello Lim Xuan Kai,
Thank you for reaching out on the Microsoft Q&A portal. Based on your screenshots and description, your Azure SRE Agent has successfully established an initial connection, but the repository clone is stuck in a "Pending" state and indicates "Repository clone has not started yet."
This behavior typically occurs when the identity used for the connection (Managed Identity, OAuth, or PAT) can authenticate to Azure DevOps, but lacks the explicit project-level or code-level permissions required to initiate a clone.
To resolve this issue, please verify the following configurations based on official Microsoft guidelines for the Azure SRE Agent:
- Confirm Identity Permissions and Access Levels: If you are using a Managed Identity to connect to the Azure DevOps repo:
- Organization Level: Navigate to Organization settings > Users in Azure DevOps. Ensure the Azure SRE Agent's managed identity is added and assigned the Basic access level. If it is set to Stakeholder, it will not have the rights to view or clone code.
- Project Level: Ensure the identity is added to the specific Azure DevOps Project and has Code (Read) permissions on the target repositories.
"If repositories don't appear after a successful connection, this usually indicates the identity has org-level but not project-level access; fix the permissions and then re-open the wizard so the repo list can load."
- Verify Token Scopes (If using PAT): If you configured the connection using a Personal Access Token (PAT), the token must possess the correct scopes.
- Edit the PAT in Azure DevOps and ensure it includes the Code (Read) (
vso.code) scope.
"If the scope is too narrow, the connector creation or access will fail and cloning will never start."
- Refresh the Connector: Once you have adjusted the permissions or generated a new token with the correct scope:
- Go to Knowledge sources in your Azure SRE Agent
- Open the Azure DevOps connector configuration.
- Re-select the Azure DevOps Project and ensure the specific repositories are checked and saved. This will trigger a fresh synchronization.
- Check Network Connectivity: Ensure that your Azure SRE Agent environment has outbound network access to
dev.azure.com. Any firewall or networking rules blocking this outbound traffic will prevent the cloning process from starting.
If the issue persists after fixing the permissions and triggering a resync, it is recommended to delete the connector entirely and recreate it to force a clean initialization.
Let me know if this helps or if you have any follow-up questions in comments.
References:
Note: This response is drafted with the help of AI systems.