Edit

Share via


Create and use an Azure SRE Agent (preview)

An Azure SRE Agent helps you maintain the health and performance of your Azure resources through AI-powered monitoring and assistance. Agents continuously watch your resources for issues, provide troubleshooting help, and suggest remediation steps available through a natural language chat interface. To ensure accuracy and control, any agent action taken on your behalf requires your approval.

This article demonstrates how to create an SRE Agent, connect it to your resources to maintain optimal application performance.

Create an agent

Create an agent by associating resource groups you want to monitor to the agent.

Prerequisites

You need to grant your agent the correct permissions and access to the right namespace.

  • Security context: Before you can create a new agent, make sure your user account has the Microsoft.Authorization/roleAssignments/write permissions using either Role Based Access Control Administrator or User Access Administrator.

  • Associate your allow list subscription ID: Make sure your Azure CLI session is set to the subscription ID on the preview allow list. If you need to set the CLI context to your subscription ID, use the following command:

    az account set --subscription "<SUBSCRIPTION_ID>"
    
  • Namespace: Using the cloud shell in the Azure portal, run the following command:

    az provider register --namespace "Microsoft.App"
    
  • Access to Sweden Central region: During preview, the only allowed region for SRE Agent is Sweden Central. Make sure your user account has owner or admin permissions and permissions to create resources in the Sweden Central region.

Create

To create an SRE Agent, follow these steps:

  1. Before you proceed, make sure to account for the mandatory prerequisites so you can create an SRE Agent instance.

  2. Follow the link provided in your onboarding email to access the Azure SRE Agent in the Azure portal.

  3. Select Create.

  4. Enter the following values in the Create agent window:

    During this step, you create a new resource group specifically for your agent which is independent of the resource group used for your application.

    In the Project details section, enter the following values:

    Property Value
    Subscription Select your Azure subscription.
    Resource group Select an existing resource group or to create a new one, enter a name.

    In the Agent details section, enter the following values:

    Property Value
    Agent name Enter a name for your agent.
    Region Select Sweden Central.

    During preview, Azure SRE Agent is only available in the Sweden Central region, but the agent can monitor resources in any Azure region.

    If you don't see any options in the dropdown, then you may not have permissions to access to the Sweden Central region.
  5. Select Choose resource groups.

  6. In the Choose resource groups to monitor window, search for the resource group you want to monitor.

    Avoid selecting the resource group link.

    From the resource group picker you'll see a checkmark ( ) next to the group name indicating the group includes services with specialized support.

    To select a resource group, select the checkbox next to the resource group.

  7. Scroll to the bottom of the dialog window and select Save.

  8. Select Create.

    Once you begin the create process, a page with the message Deployment is in progress is displayed.

Chat with your agent

Your agent has access to any resource inside the resource group associated with the agent. Use the chat feature to help you inquire about and resolve issues related to your resources.

  1. Go to the Azure portal, search for and select Azure SRE Agent.

  2. Locate your agent in the list and select the agent name.

Once the chat window loads, you can begin asking your agent questions. Here's a series of questions that can help you get started:

  • What can you help me with?
  • What subscriptions/resource groups/resources are you managing?
  • What alerts should I set up for <RESOURCE_NAME>?
  • Show me visualization of 2xx requests vs HTTP errors for my web apps across all subscriptions

If you have a specific problem in mind, you could ask questions like:

  • Why is <RESOURCE_NAME> slow?
  • Why is <RESOURCE_NAME> not working?
  • Can you investigate <RESOURCE_NAME>?
  • Can you get me the <METRIC> of <RESOURCE_NAME>?

Update managed resource groups

You can change the list of resource groups managed by your agent at any time. To change the list is of managed groups, go to your agent in the Azure portal and select the Settings tab and then Managed resource groups.

Note

Removing resource groups from the list does not remove or otherwise adversely affect resource groups.

Incident management

You can diagnose incidents in Azure App Service, Azure Container Apps, Azure Function, Azure Kubernetes Service and Azure Database for PostgreSQL by chatting with the agent directly or by connecting an incident management platform.

By default SRE Agent connects to Azure Monitor, but you can also connect it to PagerDuty.

PagerDuty integration

To set up SRE Agent with PagerDuty, you need a PagerDuty API key.

  1. In your SRE Agent resource, go to the Settings tab and select Incident Management.

  2. From the Incident platform dropdown, select PagerDuty.

  3. Enter your API key.

  4. Select Save.