Application Insights Code Optimizations for .NET is now generally available
Application Insights Code Optimizations for .NET is now generally available
Application Insights Code Optimizations helps you identify and resolve performance bottlenecks at the code level in your .NET applications running on Azure. Utilizing an advanced AI-based model, it analyzes Application Insights profiler traces and displays actionable next steps in the Azure portal at no additional cost. This saves time and increases your productivity from detection in the Azure portal to code-level resolution with GitHub Copilot.
The AI model is developed in-house based on Microsoft’s experience with large-scale cloud services like Azure, Teams, Microsoft 365, and Xbox. It is not trained or fine-tuned using your code or your performance traces. Once your App Insights profiler is collecting and uploading traces for your .NET applications, the Code Optimizations analysis happens automatically.
Identify – Application Insights Code Optimizations
Based on your feedback, you can see all Code Optimizations recommendations across Azure subscriptions and Application Insights resources in the Azure portal. This helps you keep track of code-level performance recommendations for all your environments in one place (including dev, test, pre-production and production).
Recommendations are updated every hour. By default, the view shows a rolling 24-hour window of recently identified issues. When your application is under higher load, you might see more recommendations, while during quieter periods, you might not see any. There is a 30-day history for you to review and analyze past events.
Resolve – GitHub Copilot with Code Optimizations extension (preview)
Developers are very excited about how effectively they can consult with GitHub Copilot for code fixes specific to issues detected by Code Optimizations. In either Visual Studio or Visual Studio Code, you can install the Application Insights Code Optimizations extension (preview) and have GitHub Copilot provide a code fix grounded in the Code Optimizations insights, helping to better address your specific performance issues. Please note that GitHub Copilot is required to use this capability.
How does it work? Simply open the code base corresponding to your running app on Azure that is set up for Code Optimizations. Install the extension and ask the copilot to review the Code Optimizations insights by using the @code_optimizations skill.
Application Insights profiler for .NET
The Application Insights profiler for .NET, collects performance traces of your application, then Code Optimizations automatically analyzes these traces and provides insights and actionable next steps. The Profiler runs alongside your application and is designed to run in production environments.
In response to your feedback, we have made improvements to reduce the Profiler’s impact on your servers. The AI model for Code Optimizations has enabled us to lower the trace duration by 75% – to 30 seconds, down from the previous 120 seconds. Additionally, we made several internal profiler optimizations to further reduce the overhead, including reducing the trace size by up to 55%. These changes are now being rolled out globally.
By default, Profiler actively collects traces approximately every hour for 30 seconds or during periods of high CPU or memory usage for 30 seconds. During these times, it typically adds up to 15% of CPU and memory overhead to your server. The hourly traces (called sampling) are great for proactive tuning, while the high CPU and memory traces (called triggers) are useful for reactive troubleshooting. You can further customize the Application Insights profiler settings based on your needs.
What’s next for Code Optimizations?
We are continuing to evolve the features and capabilities based on your feedback – tell us, please, how you use Code Optimizations and how we could prioritize the next investments – https://aka.ms/CodeOptimizations/Feedback.
Next steps
Review your Code Optimizations https://aka.ms/CodeOptimizations
Read more on Azure Learn https://aka.ms/CodeOptimizations/Docs
Frequently asked questions
How was the Code Optimizations AI model trained? The model was trained on Microsoft’s source code for large-scale cloud services such as Azure, Teams, Microsoft 365, and Xbox. It is not trained or fine-tuned using your code or your performance traces.
How much does Code Optimizations cost? Code Optimizations is a feature of Application Insights (documentation, pricing), it analyzes Application Insights profiler traces at no additional cost to you.
How can I provide feedback? We advise you to use the thumb-up/down functionality in the Azure portal or fill out a quick feedback.
Microsoft Tech Community – Latest Blogs –Read More