Install - .NET Agent Controller on Azure Functions for Dynamic Analysis
Overview
The vFunction Dynamic Analysis Controller can be configured for a manual installation.
In a manual
installation, the vFunction Dynamic Analysis Controller is always staged. But, it it only running when an Administrator runs the install / restart-controller / upgrade script in the Azure Functions Console. This means that, if a new version of the Application is deployed to Azure Functions or if the Application is restarted, the vFunction Dynamic Analysis Controller will need to be manually installed again.
Manual Installation
- Download the vFunction Controller Windows Installation ZIP
- Open the App from the Azure Portal
- From the left-hand sidebar, open the Development Tools > Advanced Tools > Go to launch the Kudu Console
- On the Menu Bar, open the Debug Console > PowerShell editor
- Drag-and-drop the vFunction Controller Windows Installation ZIP into
C:\home\
- Unzip the Installation ZIP, for example:
Expand-Archive -Path C:\home\vfunction-controller-windows-installation.v3.8.1527.zip -DestinationPath C:\home -Force
- In the Kudu Menu Bar, go to Process Explorer and select the Properties button for the
FunctionsNetHost.exe
process. Note that you may need to interact with your Functions in order for this process to launch after restart. Look for the first quote-enclosed string, such asC:\Program Files (x86)\SiteExtensions\Functions\4.1036.3\workers\dotnet-isolated/bin/FunctionsNetHost.exe
. Copy-and-paste this value into a text editor for use in a later step. - In the Kudu Menu Bar, go to Debug Console > PowerShell. Navigate to and edit the
C:\home\vfunction\config\installation\instances\default-dotnet\installation.yaml
- In the installation.yaml, set the required values
- In the installation.yaml, uncomment the agent.application_command. Add the string from Step #7 as the value here. Note that you will need to add single-quotes around the value. For example:
agent:
# optional versions: framework, dotnet
version: 'dotnet'
# optional environments: iis, service, command
environment: iis
application_command: 'C:\Program Files (x86)\SiteExtensions\Functions\4.1036.3\workers\dotnet-isolated/bin/FunctionsNetHost.exe'
- Save and close the installation.yaml
- In PowerShell, set the Installation Files without starting the vFunction Processes
powershell -NoProfile -ExecutionPolicy unrestricted -Command "C:\home\vfunction\controller-installation\install.ps1 -instance default-dotnet -agentMode true -runAsServices false -scriptMode true -noServices true"
- Re-open the App from the Azure Portal
- From the left-hand sidebar, select Settings > Environment Variables
- Add six new Environment Variables
Key | Value |
---|---|
CORECLR_ENABLE_PROFILING | 1 |
DOTNET_TailCallOpt | 0 |
CORECLR_PROFILER | {cd7d4b53-96c8-4552-9c11-6e41df8eab8a} |
CORECLR_PROFILER_PATH_32 | C:\\home\\vfunction\\agent\\vfagent.net.x86.dll |
CORECLR_PROFILER_PATH_64 | C:\\home\\vfunction\\agent\\vfagent.net.dll |
VF_AGENT_CONF_LOCATION | C:\\home\\vfunction\\config\\agent\\instances\\default-dotnet\\conf.json |
- Save and apply the Environment Variable changes. This will automatically restart the Azure App Service’s instance
- Re-open the Kudu PowerShell Console
- Start the vFunction processes
powershell -NoProfile -ExecutionPolicy unrestricted -Command "C:\home\vfunction\controller-installation\restart-controller.ps1 -instance default-dotnet"
- In the vFunction Server UI, confirm that the Agent is Status: Up and Start Learning
- If any issues arise: