Profile live Azure App Service apps with Application Insights
You can run Profiler on ASP.NET and ASP.NET Core apps that are running on Azure App Service using Basic service tier or higher. Enabling Profiler on Linux is currently only possible via this method.
Enable Profiler for your app
To enable Profiler for an app, follow the instructions below. If you're running a different type of Azure service, here are instructions for enabling Profiler on other supported platforms:
Application Insights Profiler is pre-installed as part of the App Services runtime. The steps below will show you how to enable it for your App Service. Follow these steps even if you've included the App Insights SDK in your application at build time.
Codeless installation of Application Insights Profiler follows the .NET Core support policy. For more information about supported runtimes, see .NET Core Support Policy.
Navigate to the Azure control panel for your App Service.
Enable "Always On" setting for your app service. You can find this setting under Settings, Configuration page (see screenshot in the next step), and select the General settings tab.
Navigate to Settings > Application Insights page.
Either follow the instructions on the pane to create a new resource or select an existing App Insights resource to monitor your app. Also make sure the Profiler is On. If your Application Insights resource is in a different subscription from your App Service, you can't use this page to configure Application Insights. You can still do it manually though by creating the necessary app settings manually. The next section contains instructions for manually enabling Profiler.
Profiler is now enabled using an App Services App Setting.
Enable Profiler manually or with Azure Resource Manager
Application Insights Profiler can be enabled by creating app settings for your Azure App Service. The page with the options shown above creates these app settings for you. But you can automate the creation of these settings using a template or other means. These settings will also work if your Application Insights resource is in a different subscription from your Azure App Service. Here are the settings needed to enable the profiler:
|APPINSIGHTS_INSTRUMENTATIONKEY||iKey for your Application Insights resource|
Enable Profiler for other clouds
|App Setting||US Government Cloud||China Cloud|
To stop or restart Profiler for an individual app's instance, on the left sidebar, select WebJobs and stop the webjob named
We recommend that you have Profiler enabled on all your apps to discover any performance issues as early as possible.
Profiler's files can be deleted when using WebDeploy to deploy changes to your web application. You can prevent the deletion by excluding the App_Data folder from being deleted during deployment.