By default, the metrics from the Function App staging deployment slot are being reported to the same Application Insights resource as production. This can generate confusion when trying to identify errors created by new code changes pushed to staging only. It is is recommended to separate the reporting of the staging slot metrics into a separate Application Insights resource.
To do so, in Azure Portal, execute the following steps:
- Navigate to Application Insights -> Add.
- Enter a new resource name.
- Set the application type to General, and enter your subscription, resource group, and location.
- Once the resource is deployed, go to Properties and copy the instrumentation key.
- Go to your Function App -> Slots -> Staging ...