A developer is deploying a Java-based API using Azure Functions. The API occasionally experiences intermittent latency spikes during high-load periods. The developer wants to capture detailed CPU and memory allocation profiles using Application Insights Profiler to identify the hot code paths. Currently, the Function App is hosted on a Consumption plan. Which of the following actions must the developer perform first to enable the Profiler?
- Upgrade the Function App hosting plan to a Premium plan or a Dedicated App Service plan.Answer
- BAdd an application setting named APPINSIGHTS_INSTRUMENTATIONKEY to reference the Application Insights resource.
- CConfigure a system-assigned managed identity for the Function App and assign it the Monitoring Contributor role.
- DCreate an App Configuration key-value pair using the @Microsoft.KeyVault syntax to store the connection string.
Answer
Upgrade the Function App hosting plan to a Premium plan or a Dedicated App Service plan.
The correct answer states that the hosting plan must be upgraded to a Premium plan or a Dedicated App Service plan. This is because Application Insights Profiler needs to run on a dedicated worker with continuous compute resources, which is not supported on the default serverless Consumption plan for Azure Functions.
Step-by-Step Solution
Key Concept
Application Insights Profiler requires a compatible compute hosting plan that supports continuous background execution (such as Premium or Dedicated plans for Azure Functions).