|
| 1 | +--- |
| 2 | +title: Troubleshoot Code Optimizations (Preview) |
| 3 | +description: Learn how to use Application Insights Code Optimizations on Azure. View a checklist of troubleshooting steps. |
| 4 | +author: rkahng |
| 5 | +ms.author: ryankahng |
| 6 | +editor: v-jsitser |
| 7 | +ms.reviewer: hannahhunter, v-leedennis |
| 8 | +ms.service: azure-monitor |
| 9 | +ms.topic: troubleshooting |
| 10 | +ms.date: 06/25/2024 |
| 11 | +ms.custom: sap:Availability Tests |
| 12 | +--- |
| 13 | + |
| 14 | +# Troubleshoot Code Optimizations (Preview) |
| 15 | + |
| 16 | +This article provides troubleshooting steps and information to use Application Insights Code Optimizations for Microsoft Azure. |
| 17 | + |
| 18 | +## Troubleshooting checklist |
| 19 | + |
| 20 | +### Step 1: View a video about Code Optimizations setup |
| 21 | + |
| 22 | +View the following demonstration video to learn how to set up Code Optimizations correctly. |
| 23 | + |
| 24 | +> [!VIDEO https://www.youtube-nocookie.com/embed/vbi9YQgIgC8] |
| 25 | +
|
| 26 | +### Step 2: Make sure that your app is connected to an Application Insights resource |
| 27 | + |
| 28 | +[Create an Application Insights resource](/azure/azure-monitor/app/create-workspace-resource) and verify that it's connected to the correct app. |
| 29 | + |
| 30 | +### Step 3: Verify that Application Insights Profiler is enabled |
| 31 | + |
| 32 | +[Enable Application Insights Profiler](/azure/azure-monitor/profiler/profiler-overview). |
| 33 | + |
| 34 | +### Step 4: Verify that Application Insights Profiler is collecting profiles |
| 35 | + |
| 36 | +To make sure that profiles are uploaded to your Application Insights resource, follow these steps: |
| 37 | + |
| 38 | +1. In the [Azure portal](https://portal.azure.com), search for and select **Application Insights**. |
| 39 | +1. In the list of Application Insights resources, select the name of your resource. |
| 40 | +1. In the navigation pane of your Application Insights resource, locate the **Investigate** heading, and then select **Performance**. |
| 41 | +1. On the **Performance** page of your Application Insights resource, select **Profiler**: |
| 42 | + |
| 43 | + :::image type="content" source="./media/code-optimizations-troubleshoot/performance-page.png" alt-text="Azure portal screenshot that shows how to navigate to the Application Insights Profiler."::: |
| 44 | + |
| 45 | +1. On the **Application Insights Profiler** page, view the **Recent profiling sessions** section. |
| 46 | + |
| 47 | + :::image type="content" source="./media/code-optimizations-troubleshoot/profiling-sessions.png" alt-text="Azure portal screenshot of the Application Insights Profiler page." lightbox="./media/code-optimizations-troubleshoot/profiling-sessions.png"::: |
| 48 | + |
| 49 | + > [!NOTE] |
| 50 | + > If you don't see any profiling sessions, see [Troubleshoot Application Insights Profiler](../profiler/profiler-troubleshooting.md). |
| 51 | +
|
| 52 | +### Step 5: Regularly check the Profiler |
| 53 | + |
| 54 | +After you successfully complete the previous steps, keep checking the Profiler for insights. Meanwhile, the service continues to analyze your profiles and provide insights as soon as it detects any issues in your code. After you enable the Application Insights Profiler, several hours might be required for you to generate profiles and for the service to analyze them. If the service detects no issues in your code, a message appears that confirms that no insights were found. |
| 55 | + |
| 56 | +## Contact us for help |
| 57 | + |
| 58 | +If you have questions or need help, [create a support request](https://ms.portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview?DMC=troubleshoot), or ask [Azure community support](https://azure.microsoft.com/support/community). You can also submit product feedback to [Azure feedback community](https://feedback.azure.com/d365community). |
0 commit comments