Blog Post

Apps on Azure Blog
3 MIN READ

Code Optimizations for Azure App Service Now Available in VS Code

fiveisprime's avatar
fiveisprime
Icon for Microsoft rankMicrosoft
Mar 23, 2026

Your production .NET app is slow, but where exactly? And how do you fix it?

Today we shipped a feature in the Azure App Service extension for VS Code that answers both questions: Code Optimizations, powered by Application Insights profiler data and GitHub Copilot.

The problem: production performance is a black box

You've deployed your .NET app to Azure App Service. Monitoring shows CPU is elevated, and response times are creeping up. You know something is slow, but reproducing production load patterns locally is nearly impossible. Application Insights can detect these issues, but context-switching between the Azure Portal and your editor to actually fix them adds friction.

What if the issues came to you, right where you write code?

What's new

The Azure App Service extension now adds a Code Optimizations node directly under your .NET web apps in the Azure Resources tree view. This node surfaces performance issues detected by the Application Insights profiler - things like excessive CPU or memory usage caused by specific functions in your code.

Each optimization tells you:

  • Which function is the bottleneck
  • Which parent function is calling it
  • What category of resource usage is affected (CPU, memory, etc.)
  • The impact as a percentage, so you can prioritize what matters

But we didn't stop at surfacing the data. Click Fix with Copilot on any optimization and the extension will:

  1. Locate the problematic code in your workspace by matching function signatures from the profiler stack trace against your local source using VS Code's workspace symbol provider
  2. Open the file and highlight the exact method containing the bottleneck
  3. Launch a Copilot Chat session pre-filled with a detailed prompt that includes the issue description, the recommendation from Application Insights, the full stack trace context, and the source code of the affected method

By including the stack trace, recommendation, impact data, and the actual source code, the prompt gives Copilot enough signal to produce a meaningful, targeted fix rather than generic advice. For example, the profiler might surface a LINQ-heavy data transformation consuming 38% of CPU in OrderService.CalculateTotals, called from CheckoutController.Submit. It then prompts copilot with the problem and it them offers a fix.

Prerequisites

  • A .NET web app deployed to Azure App Service
  • Application Insights connected to your app
  • The Application Insights profiler enabled (the extension will prompt you if it's not)

For Windows App Service plans

When creating a new web app through the extension, you'll now see an option to enable the Application Insights profiler. For existing apps, the Code Optimizations node will guide you through enabling profiling if it's not already active.

 

For Linux App Service plans

Profiling on Linux requires a code-level integration rather than a platform toggle. If no issues are found, the extension provides a prompt to help you add profiler support to your application code.

What's next

This is the first step toward bringing production intelligence directly into the inner development loop. We're exploring how to expand this pattern beyond .NET and beyond performance — surfacing reliability issues, exceptions, and other operational insights where developers can act on them immediately.

 

Install the latest  Azure App Service extension and expand the Code Optimizations node under any .NET web app to try it out. We'd love your feedback - file issues on the GitHub repo.

 

Happy Coding <3

Updated Mar 23, 2026
Version 1.0
No CommentsBe the first to comment