Retrace supports Azure Functions in App Service Plan mode. It will treat Azure Functions as a transaction, similar to a web application or a Tracked Function. It supports all of the same dependencies and will provide all of the same great insights to application performance as it does for web applications and windows services.
Note: Retrace does not work in “consumption” mode currently. We are working with Microsoft on how to work with it in the future. Microsoft is working on changes to allow it.
How it Works
Retrace works essentially the same for Azure Functions as it does for normal App Services. The .NET Profiler is enabled for your application to do lightweight profiling. We also run our agent as a Web Job to collect the data and upload it to Retrace.
Step 1: Install the Site Extension
This is done just like it is for normal App Services with Retrace. For Function Apps, select your app and then go to Platform Features -> Extensions -> Add -> Select the Stackify APM or Retrace extension.
Step 2: Set your API Key & Profiling Variables
Within your Function App, go to Platform Features -> Application Settings
Under “App settings” add these 3 settings:
Stackify.ApiKey= [your key]
Add one of the following, depending on if you are running the app in 32 or 64 bit mode:
Note: For normal App Services, we don’t require setting the 3 “COR” settings. We are working with the Microsoft team currently to see if we can simplify this.
Step 3: Optionally Enable Async support
If your code is using async/await then you will also need to add a nuget package and one line of code to your function to enable our async tracking. We are working to simplify this for future releases, check this document periodically for updates.
Add nuget package:
- Install the NuGet Package
- Add the following as the first line of code in the Function:
- Deploy your Function
Step 4: Viewing Azure Functions in Retrace
Azure Functions will now show up as its own option when you click the “Monitoring” tab at the top. They will be listed like Web Apps and Other Apps.