Install - .NET Framework 4 Dynamic Agent on Azure App Services



Overview

The vFunction Dynamic Analysis Controller can be configured for a manual or automatic installation.

In a manual installation, the vFunction Dynamic Analysis Controller is always staged. But, it it only running when an Administrator runs the installation script in the Azure App Services Console. This means that, if a new version of the Application is deployed to Azure App Services or if the Application is restarted, the vFunction Dynamic Analysis Controller will need to be manually installed again.

In an automatic installation, the vFunction Controller process is added to the repository of the Application. As part of the Application’s startup process in Azure App Services, the vFunction Dynamic Analysis Controller is launched when the Application is deployed. This means that the vFunction Dynamic Analysis Controller will always be running with the Application in Azure App Services.


Installation Wizard

To help with the installation process, vFunction offers an Installation Wizard. This Wizard provides additional information about the Prerequisites as well as steps for deploying the vFunction Agent to your environment.

Please contact support@vfunction.com or your vFunction Contact(s) for the password to start using this Wizard.


Manual Installation

  1. Download the vFunction Controller Windows Installation ZIP
  2. Open the App from the Azure Portal
  3. From the left-hand sidebar, open the Development Tools > Advanced Tools > Go to launch the Kudu Console
  4. On the Menu Bar, open the Debug Console > PowerShell editor
  5. Drag-and-drop the vFunction Controller Windows Installation ZIP into C:\home\
  6. Unzip the Installation ZIP:
### Replace VERSION with the actual vFunction release version
Expand-Archive -Path C:\home\vfunction-controller-windows-installation.vVERSION.zip -DestinationPath C:\home -Force
  1. In the Kudu Menu Bar, go to Process Explorer and select the Properties button for the w3wp.exe process. Look for the quote-enclosed string after the flag -ap. Copy-and-paste this value into a text editor for use in a later step. If it exists, avoid the Process that starts as “~1” since this is a Management Process
  2. The full path to the w3wp.exe process dictates whether this is a 32-bit or 64-bit, e.g. C:\Windows\System32 or C:\Windows\SysWOW64. Note whether this is a 32-bit or 64-bit w3wp.exe process for use in a later step
  • x86 = C:\Windows\System32
  • x64 = C:\Windows\SysWOW64
  1. Add the Environment Variables for the vFunction Dynamic Agent and install the Agent
### Replace the $CHANGE_ME values with the Required Configuration Settings. For detailed Settings explanations, see:
### https://kb.vfunction.com/installations/configurable-settings/mono-dynamic-agent/dotnet/windows
powershell -NoProfile -ExecutionPolicy unrestricted -Command "
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_NAME -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_HOST -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_APP_ID -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_ORG_ID -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_CLIENT_ID -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_CLIENT_SECRET -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_INSTANCE_ID -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_CONTROLLER_TAG -Value '$CHANGE_ME';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_AGENT_VERSION -Value 'framework';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_AGENT_APPLICATION_NAME -Value '$CHANGE_ME_FROM_STEP_7';
New-Item -Path Env:\VF_CONTROLLER_DEFAULT_DOTNET_AGENT_ARCHITECTURE -Value '$CHANGE_ME_FROM_STEP_8';
C:\home\vfunction\controller-installation\install.ps1 -instance default-dotnet -scriptMode true -runAsServices false"
  1. Re-open the App from the Azure Portal
  2. From the left-hand sidebar, select Settings > Environment Variables
  3. Add six new Environment Variables based on the .NET version
Key Value
COR_ENABLE_PROFILING 1
COMPlus_TailCallOpt 0
COR_PROFILER {cd7d4b53-96c8-4552-9c11-6e41df8eab8a}
COR_PROFILER_PATH_32 C:\home\vfunction\agent\vfagent.net.x86.dll
COR_PROFILER_PATH_64 C:\home\vfunction\agent\vfagent.net.dll
VF_AGENT_CONF_LOCATION C:\home\vfunction\config\agent\instances\default-dotnet\conf.json
  1. Save and apply the Environment Variable changes. This will automatically restart the Azure App Service’s instance
  2. In the vFunction Server UI, confirm that the Agent is Status: Up and Start Learning
  3. If any issues arise:

Automatic Installation

Notes

The installation workflow below will require you to update the deploy.cmd if you do not want to use the default locations. You would want to do this if:

  • You want to use a different directory than ROOT/vfunction-stuff as the location for the vFunction Configuration Files
  • You want to use a different directory than ROOT/wwwroot as the vFunction Installation location
Installation Workflow
  1. Ensure prerequisites are met
  2. Download the vFunction Controller Windows Installation ZIP
  3. Rename this ZIP to be vfunction-controller-windows-installation.zip
  4. Download the vFunction .deployment
  5. Download the vFunction deploy.cmd
  6. Open the App from the Azure Portal
  7. From the left-hand sidebar, open the Development Tools > Advanced Tools > Go to launch the Kudu Console
  8. In the Kudu Menu Bar, go to Process Explorer and select the Properties button for the w3wp.exe process. Look for the quote-enclosed string after the flag -ap. Copy-and-paste this value into a text editor for use in a later step. If it exists, avoid the Process that starts as “~1” since this is a Management Process
  9. The full path to the w3wp.exe process dictates whether this is a 32-bit or 64-bit, e.g. C:\Windows\System32 or C:\Windows\SysWOW64. Note whether this is a 32-bit or 64-bit w3wp.exe process for use in a later step
  • x86 = C:\Windows\System32
  • x64 = C:\Windows\SysWOW64
  1. Modify the deploy.cmd. Replace the $CHANGE_ME values with the required configuration settings
  2. Open your project’s root directory for the Application in your code editor of choice
  3. Copy the downloaded .deployment and the modified deploy.cmd into the project’s root directory
  4. Create a folder named vfunction-stuff in the project’s root directory
  5. Into the folder, upload the downloaded and renamed vfunction-controller-windows-installation.zip
  6. Deploy your application to Azure App Services
  7. Confirm that the Application comes up and functions as expected
  8. If any issues arise:
  1. Re-open the App from the Azure Portal
  2. From the left-hand sidebar, select Settings > Environment Variables
  3. Add six new Environment Variables based on the .NET version
Key Value
COR_ENABLE_PROFILING 1
COMPlus_TailCallOpt 0
COR_PROFILER {cd7d4b53-96c8-4552-9c11-6e41df8eab8a}
COR_PROFILER_PATH_32 C:\home\vfunction\agent\vfagent.net.x86.dll
COR_PROFILER_PATH_64 C:\home\vfunction\agent\vfagent.net.dll
VF_AGENT_CONF_LOCATION C:\home\vfunction\config\agent\instances\default-dotnet\conf.json
  1. Save and apply the Environment Variable changes. This will automatically restart the Azure App Service’s instance