Enable Profiler for Azure App Service apps
Application Insights Profiler is pre-installed as part of the App Services runtime. You can run Profiler on ASP.NET and ASP.NET Core apps running on Azure App Service using Basic service tier or higher. Follow these steps even if you've included the App Insights SDK in your application at build time.
To enable Profiler on Linux, walk through the ASP.NET Core Azure Linux web apps instructions.
Note
Codeless installation of Application Insights Profiler follows the .NET Core support policy.
For more information about supported runtime, see .NET Core Support Policy.
Prerequisites
- An Azure App Services ASP.NET/ASP.NET Core app.
- Application Insights resource connected to your App Service app.
Verify "Always On" setting is enabled
In the Azure portal, navigate to your App Service.
Under Settings in the left side menu, select Configuration.
Select the General settings tab.
Verify Always On > On is selected.
Select Save if you've made changes.
Enable Application Insights and Profiler
For Application Insights and App Service in the same subscription
If your Application Insights resource is in the same subscription as your App Service:
Under Settings in the left side menu, select Application Insights.
Under Application Insights, select Enable.
Verify you've connected an Application Insights resource to your app.
Scroll down and select the .NET or .NET Core tab, depending on your app.
Verify Collection Level > Recommended is selected.
Under Profiler, select On.
- If you chose the Basic collection level earlier, the Profiler setting is disabled.
Select Apply, then Yes to confirm.
For Application Insights and App Service in different subscriptions
If your Application Insights resource is in a different subscription from your App Service, you'll need to enable Profiler manually by creating app settings for your Azure App Service. You can automate the creation of these settings using a template or other means. The settings needed to enable the Profiler:
App Setting | Value |
---|---|
APPINSIGHTS_INSTRUMENTATIONKEY | iKey for your Application Insights resource |
APPINSIGHTS_PROFILERFEATURE_VERSION | 1.0.0 |
DiagnosticServices_EXTENSION_VERSION | ~3 |
Set these values using:
Enable Profiler for regional clouds
Currently the only regions that require endpoint modifications are Azure Government and Azure China.
App Setting | US Government Cloud | China Cloud |
---|---|---|
ApplicationInsightsProfilerEndpoint | https://profiler.monitor.azure.us |
https://profiler.monitor.azure.cn |
ApplicationInsightsEndpoint | https://dc.applicationinsights.us |
https://dc.applicationinsights.azure.cn |
Enable Azure Active Directory authentication for profile ingestion
Application Insights Profiler supports Azure AD authentication for profiles ingestion. For all profiles of your application to be ingested, your application must be authenticated and provide the required application settings to the Profiler agent.
Profiler only supports Azure AD authentication when you reference and configure Azure AD using the Application Insights SDK in your application.
To enable Azure AD for profiles ingestion:
Create and add the managed identity to authenticate against your Application Insights resource to your App Service.
Configure and enable Azure AD in your Application Insights resource.
Add the following application setting to let the Profiler agent know which managed identity to use:
For System-Assigned Identity:
App Setting Value APPLICATIONINSIGHTS_AUTHENTICATION_STRING Authorization=AAD
For User-Assigned Identity:
App Setting Value APPLICATIONINSIGHTS_AUTHENTICATION_STRING Authorization=AAD;ClientId={Client id of the User-Assigned Identity}
Disable Profiler
To stop or restart Profiler for an individual app's instance:
Under Settings in the left side menu, select WebJobs.
Select the webjob named
ApplicationInsightsProfiler3
.Click Stop from the top menu.
Select Yes to confirm.
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.
Next steps
Learn how to...
Feedback
Submit and view feedback for