Written for FRENDS version 4.5

Prerequisites

This guide will be expanding on the Installing an Agent how to so you will need to meet the perquisites for that in addition to the ones listed below.

  • The drive you wish to map the file share to, e.g. Y

  • Username to access the share e.g. AZURE\myazurefileaccount

  • Password to access the share e.g. xxxyyyzzz==

  • the share location e.g. \myazurefileaccount.file.core.windows.net\myazurefiles

Overview

The Frends Agent mounts file shares upon startup according to its configuration file FrendsAccService.exe.config. 

This setting can be either written by the installer according to a configuration transformation or by editing the configuration file directly. 

Creating a configuration transformation file for the installer

It is recommended to use a transformation file to add the file share setting to the configuration. This is due to the configuration file being overwritten on each install. By reusing the transformation, the configuration file will always have the file share setting set.

  1. Create a directory AgentInstallerDirectory\additionalFiles next to the installer and config.json file. Create a file named FileShares.agentServiceTransformation in the directory.

  2. Add the following content to the file with the correct values edited in from the prerequisites, remember to escape backslashes(\):

<configuration xmlns:xdt='http://schemas.microsoft.com/XML-Document-Transform'>
  <appSettings>
    <add key='MappedDriveSettingsJson' value='' xdt:Transform='InsertIfMissing' xdt:Locator='Match(key)' />
    <add key="MappedDriveSettingsJson" value='[
    {
        "DriveLetter": "Y",
        "PathToMap": "\\\\myazurefileaccount.file.core.windows.net\\myazurefiles",
        "Password": "xxxyyyzzz==",
        "UserName": "AZURE\\myazurefileaccount"
    }]'
    xdt:Transform='SetAttributes' xdt:Locator='Match(key)' />
    </appSettings>
</configuration>
  1. Run the installer according to the Installing an Agent how-to.

  2. The FRENDS Agent should now map the drive according to the configuration settings on startup.

Modifying the Agent configuration manually

If you only want to set up the file share mapping once without reinstalling the agent, e.g. to test the mapping, you can do the needed changes manually to the configuration file as well. 

Note that any changes to the configuration file will be lost when you install a new version of the agent, and you would need to do the changes again after the update. It is highly recommended to use the configuration transformation instead.

  1. Backup and then open up the FrendsAccService.exe.config file located in the FRENDS Agent installation directory.

  2. Add the following setting inside the <appSettings> element with the approriate settings from the prerequisites

<add key="MappedDriveSettingsJson" value='[
    {
        "DriveLetter": "Y",
        "PathToMap": "\\\\myazurefileaccount.file.core.windows.net\\myazurefiles",
        "Password": "xxxyyyzzz==",
        "UserName": "AZURE\\myazurefileaccount"
    }]' />
  1. Restart the FRENDS Agent service

  2. The FRENDS Agent should now map the drive according to the configuration settings on startup.

Using the file share

Processes should now be able to access the mounted file share normally, e.g. Y:\myFile.xml

    

  

Did this answer your question?