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.
Enable "Always On" setting for your app service. You can update the setting in the Configuration page of your App Service under General Settings.
Go to the App Services pane in the Azure portal.
Navigate to Settings > Application Insights pane.
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|
Enabling Profiler for other clouds manually
If you want to enable the profiler for other clouds, you can use the below app settings.
|App Setting||US Government Values||China Cloud|
To stop or restart Profiler for an individual app's instance, under Web Jobs, go to the app resource. To delete Profiler, go to Extensions.
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.