Azure Installation

This page shows the Hdiv agent installation options in the Azure Cloud services, such as Azure Virtual Machines, Cloud Services or Azure App Services.

The installation file for Azure Virtual Machines is an msi file, and for Azure App Services, it is a NuGet package.

Azure Virtual Machines or Cloud Services

The installation steps for Azure Virtual Machines or Cloud Services are the same as for on-premises installation. It is necessary to open a remote desktop session and install the msi file provided.

Steps for the on-premises installation.

Azure App Services

In order to install the agent in an application deployed in Azure App Services, a new NuGet dependency is included in the application.

Package to include: Hdiv.AST.Profiler.[Platform]

Supported Platforms

Current Platform options are Windows or Linux

Package compatibility for Windows

The same package is valid for Full Framework and NetCore applications.

Azure App Services Limitations

Azure installation has some limitations compared to the on-premises installation. .Net agent does not support framework 3.5 or lower and CLR2. Check the general requirements.

Step 1

Hdiv provides a repository to access this package. It is necessary to set up the NuGet repository using the credentials provided by the Hdiv support team. Repository configuration steps.

Step 2

Once the repository is configured, add the Hdiv.AST.Profiler.[Platform] package reference to the application:

  • From Visual Studio - in the application project References, Manage Nuget Packages, search for Hdiv.AST.Profiler and add it to the project.
  • From .NET CLI - dotnet add package Hdiv.AST.Profiler.[Platform] --version x.y.z

Build the application to check the Hdiv agent package is installed properly.

Step 3

Deploy the application on Azure App Services as usual. Ensure Hdiv agent installation is correct by checking that a new folder called 'hdivsecurity' exists in the application root folder.

Step 4

It is necessary to add some environment variables to set up the Agent.

Add them from the Azure portal application settings page.

Usage

Restart the application to apply the changes.

Step 5

Once the application restarts, there are two ways to check the agent is running properly:

  • Check server and application are registed in the Hdiv Console.
  • Review agent logs, for example using Kudu. Find log files in D:\home\site\wwwroot\hdivsecurity\logs or /home/site/wwwroot/hdivsecurity/logs in case of Linux App Service.

Disable the agent by changing the CLR_ENABLE_PROFILING or CORECLR_ENABLE_PROFILING property from 1 to 0.

Azure App Services Environment Variables

Environment variables to use in Full framework or NetCore applications:

Full Framework

Name Value
COR_ENABLE_PROFILING 1
COR_PROFILER {1adbf8d7-8774-4733-aa10-4376ba3bd37a}
COR_PROFILER_PATH_32 D:\Home\site\wwwroot\hdivsecurity\agent\x86\Hdiv.AST.Clr.Profiler.dll
COR_PROFILER_PATH_64 D:\Home\site\wwwroot\hdivsecurity\agent\x64\Hdiv.AST.Clr.Profiler.dll
HDIV_AGENT_HOME D:\Home\site\wwwroot\hdivsecurity\agent
HDIV_AGENT_PROFILER_PLATFORM 327680
HDIV_NET_AST_BRIDGE_ENABLED true
HDIV_LICENSE_DATA text_mode_license
HDIV_CONSOLE_URL http://console-host:8089/hdiv-console-services
HDIV_CONSOLE_TOKEN token-value
HDIV_SERVER_NAME server

.Net Core

Name Platform Value
CORECLR_ENABLE_PROFILING Windows & Linux 1
CORECLR_PROFILER Windows & Linux {1adbf8d7-8774-4733-aa10-4376ba3bd37a}
CORECLR_PROFILER_PATH_32 Windows D:\Home\site\wwwroot\hdivsecurity\agent\x86\Hdiv.AST.Clr.Profiler.dll
Linux not supported
CORECLR_PROFILER_PATH_64 Windows D:\Home\site\wwwroot\hdivsecurity\agent\x64\Hdiv.AST.Clr.Profiler.dll
Linux /home/site/wwwroot/hdivsecurity/agent/x64/Hdiv.AST.Clr.Profiler.so
HDIV_AGENT_HOME Windows D:\Home\site\wwwroot\hdivsecurity\agent
Linux /home/site/wwwroot/hdivsecurity/agent
HDIV_AGENT_PROFILER_PLATFORM Windows & Linux 327680
HDIV_LICENSE_DATA Windows & Linux text_mode_license
HDIV_CONSOLE_URL Windows & Linux http://console-host:8089/hdiv-console-services
HDIV_CONSOLE_TOKEN Windows & Linux token-value
HDIV_SERVER_NAME Windows & Linux server

HDIV_LICENSE_DATA

Find the license in the license/license.txt file of the provided package.

env.properties configuration values

Add any property included in the env.properties configuration in an on-premises installation using the environment variables.

HDIV_CONSOLE_URL

Enter the URL of your Hdiv console.

HDIV_CONSOLE_TOKEN

Enter the console token provided by Hdiv.

HDIV_SERVER_NAME

Enter the name of the server. Use a name that identifies the server where the agent is installed. This name will be shown in the console.

Hdiv NuGet Configuration

Agent packages are published in the Hdiv repository: https://artifacts.hdivsecurity.com/nexus/service/local/nuget/nuget/.

Add the new source from the VS NuGet settings configuration window. Use the credentials provided to access the repository.

Usage

Alternativelly, add it from the command line:

nuget sources add -name "Hdiv NuGet" -source https://artifacts.hdivsecurity.com/nexus/service/local/nuget/nuget/ -username username -password password

General installation & configuration details

Find general agent configuration details in the installation page.