How I built an app to manage Azure using AI

This article is my entry into this year’s Azure Spring Clean 2026 event. Huge thanks to the organisers!

A customer asked me how to interpret Azure Application Insights and whether it would be possible to build a web app to help them understand what Application Insights was reporting about app performance.

The prompt I used was as follows:-

To run this, I went into GitHub Copilot CLI and then used/plan and then type the prompt

I need a website to look at my production application insights and help me figure out the good and the bad within it – the resource is called appinsights-customername-prod, in the resource group called rg-app-insights-prod within the subscription <redacted> – do this using the latest version of C #.

That’s it, the full prompt, start small, build onto itas you go. As you may guess, this is quite a vague prompt, but enough to get started with.

The plan it comes back looked like so:-

Plan: Application Insights Health Dashboard (Blazor Server, .NET 9)

Blazor Server web application that queries the production Application Insights resource using the Azure Monitor Query SDK and DefaultAzureCredential, presenting a real-time dashboard split into “green” (healthy signals) and “red” (problems) sections with a user-selectable time range.

Project Layout

All files created inside a new c:\personal\code\phillip\AppInsightsDashboard\ folder:

Steps

  1. Create the project — dotnet new blazorserver targeting net9.0 at c:\personal\code\gregor\AppInsightsDashboard
  2. Add NuGet packages to the .csproj:
    • Azure.Monitor.Query — logs (KQL) and metrics queries
    • Azure.Identity — DefaultAzureCredential for auth (uses az login locally)
  3. Configure appsettings.json — store only the non-secret App Insights resource ID:
    • Resource ID: /subscriptions/<redacted>/resourceGroups/rg-app-insights-prod /providers/microsoft.insights/components/appinsights-customername-prod
    • No connection strings or secrets in config
  4. Program.cs — register LogsQueryClient and MetricsQueryClient as singletons using DefaultAzureCredential, register AppInsightsQueryService as scoped
  5. AppInsightsQueryService.cs — wraps LogsQueryClient.QueryResourceAsync(resourceId, kql, timeRange) and exposes typed async methods for each dashboard section:
    • GetSummaryAsync(TimeRange) → total requests, success %, avg duration, exception count
    • GetSlowestEndpointsAsync(TimeRange) → p50/p95/p99 by operation name
    • GetExceptionSummaryAsync(TimeRange) → exception type, count, last seen
    • GetDependencyHealthAsync(TimeRange) → name, success rate, avg duration
    • GetFailedRequestsAsync(TimeRange) → recent failed requests with details
    • GetRecentExceptionsAsync(TimeRange) → raw exception feed
  6. KQL queries used (all target the App Insights classic tables via QueryResourceAsync):
    • requests | where timestamp > ago(Xh) | summarize ...
    • exceptions | where timestamp > ago(Xh) | summarize count() by type | order by count_ desc
    • dependencies | where timestamp > ago(Xh) | summarize ...
    • Performance percentiles via percentiles(duration, 50, 95, 99)
  7. Dashboard.razor — the main page with:
    • Time range selector (dropdown: 1h / 6h / 24h / 7d) that triggers re-query
    • Summary cards row: total requests, success rate (colour-coded), avg duration, exception count
    • “The Good” section: top performing endpoints, successful dependency calls
    • “The Bad” section: failed requests, top exceptions, slow dependencies
    • Loading spinner while queries run; error boundary for query failures
  8. Performance.razor — sortable table of all endpoints with p50/p95/p99 duration, request volume, failure rate
  9. Exceptions.razor — exception type breakdown bar chart (using inline SVG or a lightweight JS chart interop) + scrollable raw exception feed with stack trace expansion
  10. Dependencies.razor — dependency type (SQL, HTTP, etc.) success/failure rates and avg duration, colour-coded rows (red if success rate < 95%)
  11. MainLayout.razor — simple nav sidebar linking to the four pages, shows the App Insights resource name in the header

Authentication note

Locally, DefaultAzureCredential picks up az login credentials automatically. The signed-in account needs at least Reader on rg-enogrp-point-prd-workload and Log Analytics Reader on the linked workspace (or Monitoring Reader at the resource group level).


Verification

  • dotnet run → opens http://localhost:5000, dashboard loads with real data
  • Time range dropdown changes refresh all cards without page reload
  • Red/amber/green thresholds visible: success rate < 99% = amber, < 95% = red; avg duration > 500ms = amber
  • Navigate to each sub-page and confirm tables populate

Decisions

  • QueryResourceAsync used over QueryWorkspaceAsync — no need to look up the linked workspace ID separately; App Insights resource ID is sufficient for all requests/exceptions/dependencies/traces tables
  • Blazor Server chosen over WASM — avoids CORS concerns with Azure SDK calls from browser, keeps credentials server-side
  • DefaultAzureCredential — zero-config for local az login use, Managed Identity ready if later deployed to Azure

Confirm this plan and I can hand it off to an implementation agent, or let me know if you’d like any adjustments (e.g. add a specific custom event table, change colour thresholds, add charts library, etc.).

I then confirm the plan and this was the end result.

So, from a single prompt, I have a new Blazor website with an overview page, a performance page, an exceptions page, and a dependencies page. Now I can go back, style it, change it, add to it, do whatever I want.

I have no dependencies on other tools, I don’t need to version it, and tell people there is an update available, there is nothing to download and install – I am using AI to do the job for me.

Pro tip: Once you’re happy with changes, ask AI to code review, ask it how I can make it even better, more secure, etc., and then and only then create a PR and check it in after it’s been reviewed.

This is just how easy it is to create a web app that you can use, run locally, and build all sorts of useful tools.

Here are further blog posts on this topic. If you want to see examples of how to look after your Azure Environment, check out the article – https://gregorsuttie.com/2026/02/19/how-i-used-github-copilot-cli-to-build-an-azure-governance-web-app-from-zero-to-maturity-score-in-one-weekend/