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.
Artificial Intelligence (AI) agents are revolutionizing the way people and applications engage with data by integrating large language models (LLMs) with external tools and databases. Agents streamline complex workflows, improve the accuracy of information retrieval, and provide an intuitive, natural language interface to your data. This article describes how to train an AI agent to understand FinOps, the FinOps Open Cost and Usage Specification (FOCUS), and connect to data in a FinOps hub instance.
Prerequisites
- Deployed a FinOps hub instance with Data Explorer.
- Configured scopes and ingested data successfully.
- Database viewer or greater access to the Data Explorer Hub and Ingestion databases. Learn more.
Configure GitHub Copilot in VS Code
The simplest way to get started with an AI-powered FinOps hub is with GitHub Copilot Agent mode.
Sign up for GitHub Copilot Free if you don't have GitHub Copilot.
Install Node.js 20 or later.
Install VS Code.
Open a workspace and save GitHub Copilot instructions for FinOps hubs:
- Open VS Code.
- Open a folder or workspace where you want to connect to your FinOps hub instance.
- Create a
.github
folder at the root of the workspace. - Download the GitHub Copilot instructions for FinOps hubs and extract the contents to the
.github
folder.
Install GitHub Copilot and Azure MCP:
For details about the Azure MCP server, see Azure MCP on GitHub.
Connect from other AI platforms
FinOps hubs use Model Context Protocol (MCP) to connect to and query your data in Azure Data Explorer using the Azure MCP server. Besides GitHub Copilot, there are many popular clients that support MCP servers, like Claude, Continue, and more. While we have not tested instructions with other clients, you may be able to reuse some or all of the AI instructions for FinOps hubs with other clients. Try the instructions with clients you use and create a change request or submit a pull request if you discover any gaps or improvements.
To learn more about the Azure MCP server, see Azure MCP on GitHub.
Query FinOps hubs with AI
After you install the Azure MCP server and configure your AI client, use the following sample steps to connect and query your FinOps hub instance. These steps are based on GitHub Copilot Agent mode with the AI instructions for FinOps hubs. They may work differently in other clients.
Connect to your hub
If you're using GitHub Copilot, start by opening Chat in Agent mode:
The AI instructions for FinOps hubs are preconfigured for FinOps tasks and already know how to find and connect to your FinOps hub instance. To start, ask to connect to your FinOps hub instance:
/ftk-hubs-connect
Copilot should automatically connect to your FinOps hub instance. If you have multiple, you should see a list of them. You can ask to connect to them by resource group, hub name, cluster name, cluster short URI (cluster name and location), or the full cluster URI.
When connecting to your hub, you may get prompted to use your credentials. Select Continue.
The rest of the steps will use the FinOps capabilities to demonstrate an example of the type of questions you can ask.
Data ingestion: Get last refresh time
Your queries are only as complete as your data. Start by checking when the data was last loaded into your FinOps hub instance. This should be part of the first connection step. You can also ask directly:
When was my data last refreshed?
Cost Management exports typically run every 24 hours. If using managed exports, you can configure the schedule to run more frequently. If data is not up-to-date, check Cost Management exports.
Allocation: Cost by resource group
The most common way to allocate costs in Azure is by resource group. To identify the resource groups with the most cost, ask:
What are the top resource groups by cost?
You can also ask about subscriptions (SubAccountName in FOCUS), invoice sections, or even tag.
Reporting + analytics: Biggest changes in cost trends
The last two examples were fairly straightforward. Let's try something a little more complex by asking it to analyze trends over time. Copilot will do some research first to devise a plan. And given the complexity, Copilot may also ask you to review and approve a KQL query that it will execute to perform the analysis.
Analyze cloud service spending trends over the past 3 months. Show the top 5 services with the highest increase and top 5 with the highest decrease in cost, including percentage changes.
If asked to approve the query, you can tell Copilot to tweak or execute the query based on your needs.
Given the complexity of this one, you may want to ask for the query so you can run it yourself. You can always run the same queries from the Data Explorer portal. Or ask Copilot to give you a link to run the query:
Give me a link to run this query myself.
Anomaly management: Identify anomalies
Now let's look for anomalies:
Are there any unusual spikes in cost over the last 3 months?
You should get a summary of what was found, whether there were anomalies or not. This is another place where you may want to ask for a link to the query to see the details for yourself. You can also ask for the query or even have it explain the query.
Show me the query with comments on each line to explain what the line does.
This should use the built-in Data Explorer anomaly detection functionality. Ask Copilot to explain anything you don't understand. This can be a great opportunity to learn KQL. Tell Copilot to change the query or tweak it yourself to suit your needs.
In my case, it added empty lines between each commented line. To run this, you will need to select all the text in the Data Explorer query editor and select Run.
Forecasting: Project end of month costs
Anomaly detection is about predicting what the cost of a day would be based on a forecast. So if Copilot can help you analyze historical forecasts with built-in Data Explorer capabilities, then you can also project out future costs:
Show me the cost for last month, this month, and the forecasted cost by the end of the month for the subscriptions that have the highest cost this month.
Rate optimization: Quantifying savings
Next, let's look at savings. Let's look for savings from both negotiated discounts and commitment discounts, and quantify Effective Savings Rate (ESR) to give us an idea of how we're doing with our rate optimization efforts:
What was my cost last month, how much did I save on commitment discounts, and how much did I save with my negotiated discounts? Show my total savings and effective savings rate.
Explore your data
These are just a few examples of the types of requests you can get answers to today. Ask your own questions and test how AI can help you. Just remember that AI is limited to what it's taught and the data it has available. If you find a scenario that is not covered or could be improved, please share the prompt, what response you received, and how you would like to see it improved as a FinOps toolkit change request.
Give feedback
Let us know how we're doing with a quick review. We use these reviews to improve and expand FinOps tools and resources.
If you're looking for something specific, vote for an existing or create a new idea. Share ideas with others to get more votes. We focus on ideas with the most votes.
Related content
Related FinOps capabilities:
Related products:
Related solutions: