Supported Azure functions
Versions
Runtime version | Language version | Supported | Not supported |
---|---|---|---|
1.x | .NET Framework 4.8 |
|
|
3.x | .NET 5 |
|
|
4.x | .NET 6 |
|
|
Note
For all versions, running the Azure Functions application in isolated mode is not supported by the .NET agent.
Supported triggers
HTTP
Service Bus
Configuration
Azure Functions supports three deployment scenarios: Windows applications, Linux applications, and Docker Linux images. Of those three, only Windows applications and Docker Linux images are compatible with the agent. Linux application deployment is not supported by the .NET agent.
Windows Application
The Windows application deployment option is fully supported for Azure Functions versions 1, 3, and 4. Locally, the application can reference the Contrast .NET Core Agent NuGet package. On Azure, you must install the Contrast .NET Core Site Extension. When you deploy the Azure Function application using a tool (for example, Visual Studio or Core Tools), in a CI/CD pipelilne or using the Azure Functions portal editor, the site extension will not automatically set the required application settings. You must specify the application settings manually.
To do this, set the following application settings (Settings > Configuration > Application settings) to enable the agent to attach:
CORECLR_ENABLE_PROFILING=1 CORECLR_PROFILER={8B2CE134-0948-48CA-A4B2-80DDAD9F5791} CORECLR_PROFILER_PATH_32=C:\home\SiteExtensions\Contrast.NetCore.Azure.SiteExtension\ContrastNetCoreAppService-<version>\runtimes\win-x86\native\ContrastProfiler.dll CORECLR_PROFILER_PATH_64=C:\home\SiteExtensions\Contrast.NetCore.Azure.SiteExtension\ContrastNetCoreAppService-<version>\runtimes\win-x64\native\ContrastProfiler.dll
Where <version> is the version of the agent in the form "0.0.0.0". For example, if the agent version is "2.1.8" the path would be: C:\home\SiteExtensions\Contrast.NetCore.Azure.SiteExtension\ContrastNetCoreAppService-2.1.8.0\runtimes\win-x64\native\ContrastProfiler.dll
.
Connection information for Contrast server can be supplied either using application settings or in a configuration file that is pointed to by an application setting.
Application settings
CONTRAST__API__USER_NAME=my_username CONTRAST__API__SERVICE_KEY=my_service_key CONTRAST__API__API_KEY=my_api_key CONTRAST__API__URL=my_api_url
If Contrast server connection information is supplied via configuration file, the following application setting must be set: CONTRAST_CONFIG_PATH=C:\home\site\wwwroot\contrast_security.yaml
Docker Linux image
The custom Linux image deployment option is supported for Azure Functions versions 3 and 4. A custom Linux image is required and it must contain the application and the Contrast .NET Core Agent NuGet package. Note that Linux applications, when not run from a custom Linux image, are not supported by the .NET agent.
The following application settings must be set in order for the agent to attach. These can either be in the image itself (as environment variables) or set as application settings (Settings > Configuration > Application settings).
CORECLR_ENABLE_PROFILING=1 CORECLR_PROFILER={8B2CE134-0948-48CA-A4B2-80DDAD9F5791} CORECLR_PROFILER_PATH=/home/site/wwwroot/contrast/runtimes/linux-x64/native/ContrastProfiler.so CORECLR_PROFILER_PATH_64=/home/site/wwwroot/contrast/runtimes/linux-x64/native/ContrastProfiler.so CONTRAST_CORECLR_INSTALL_DIRECTORY=/home/site/wwwroot/bin/contrast/
Connection information for Contrast server can be supplied either using application settings/environment variables or in a configuration file that is pointed to by an application setting/environment variable.
Application setting/environment variables:
CONTRAST__API__USER_NAME=my_username CONTRAST__API__SERVICE_KEY=my_service_key CONTRAST__API__API_KEY=my_api_key CONTRAST__API__URL=my_api_url
If the Contrast server connection information is supplied via configuration file, the following application setting/environment variable must be set: CONTRAST_CONFIG_PATH=/home/site/wwwroot/contrast_security.yaml