Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
By connecting your monitored resources to a source code repository through Azure SRE Agent, you create a direct link between the agent and your code base for detailed analysis, reporting, and issue management and mitigation.
When you create a link between SRE Agent and your code, you get:
Detailed root cause analysis reporting: SRE Agent root cause analysis uses source code references pinpoint down to individual lines of code as the source of issues in your environment.
Automated work ticket generation: When an issue is found, the agent can create work items for you in either Azure DevOps or GitHub.
The following source code hosting providers are supported with Azure SRE Agent.
- GitHub
- Azure DevOps
Connect a repository
Note
The Code Search extension must be installed on your Azure DevOps organization for repository files to be searchable. It can take an hour for your repository files to be searchable after you install this extension.
Before you can connect an Azure DevOps Repo to a resource, you first need to associate the agent managed identity with the repository.
Open your instance of SRE Agent in the Azure portal.
Select Settings and copy the name of the managed identity listed in the settings window.
Open your Azure DevOps repository.
Select the Invite button in the upper left so you can add the agent's managed identity to the repo.
In the Users box, enter and select the name of your SRE Agent.
Select Add.
Copy the URL of the repository to the clipboard.
Return to the SRE Agent in the portal, and in the chat window ask the agent to connect to the repository.
Format you request to resemble the following format:
connect <RESOURCE_NAME> to this Azure DevOps repo: <REPO_URL>Before you submit the prompt, update the example to replace
<RESOURCE_NAME>with the name of the app or resource where the code is deployed, and replace<REPO_URL>with the URL of the Azure DevOps repository using the following format:https://dev.azure.com/organization/<PROJECT_NAME>/_git/<REPO_NAME>
Note
You must have a GitHub Copilot plan other than the Free plan. A GitHub Pro free trial plan will work for testing purposes, but the plan converts to a paid plan after the free trial ends. Additionally, you must enable the Copilot Coding Agent for the repository, in the GitHub organization settings.
Open your instance of SRE Agent in the Azure portal.
Select the Resource mapping tab.
Select Grid view radio button.
Expand the section for the resource you in which want to connect a repository.
Select Connect repository
Enter the repository URL in the box.
The URL needs to match the following format:
https://github.com/<OWNER>/<REPO_NAME>Select Connect repository.
A new panel now appears on the right with profile details for the resource.
Scroll down the panel and select Authorize repository access and follow the authorization flow to connect your repository.
Your source code repository is now connected to the Azure resource and available to SRE Agent for root cause analysis reporting.