In the Delft-FEWS Basebuild distribution, there is a powershell script called setEnvFromJsonBase64.ps1 that can be used to install a FSS as a service on an Azure Virtual Machine using a custom script extension (CSE). The fssLauncher will be started as a service using the NT AUTHORITY\Network Service account.
# Call the setEnvFromJsonBase64.ps1 script in Azure Custom Script Extension for Virtual Machine Scale Set "variables": { "env": { "FEWS_FSS_HOME_DIR": "d:\fews\fss", "FEWS_FSS_INDEX_1_DATABASE_URL": "jdbc:postgresql://dummy_hostname:5432/dummy_databasename", "FEWS_FSS_INDEX_1_DATABASE_USER": "dummy_username", "FEWS_FSS_INDEX_1_DATABASE_ENCRYPTED_PASSWORD": "dummy_encrypted_password", "FEWS_FSS_INDEX_1_CLIENT_CONFIG_FILE_NAME": "fss_clientConfig.xml", "FEWS_FSS_INDEX_1_GROUP": "windows" } }, "commandToExecute": "[concat('powershell -ExecutionPolicy UnRestricted ', 'Start-BitsTransfer -Source "https://mystorage.blob.core.windows.net/builds/fews-stable-201802-87056-bin.zip" -Destination "d:\bin.zip";', 'Expand-Archive "d:\bin.zip" -DestinationPath "d:\fews\bin";', 'Remove-Item -Path "d:\bin.zip";', 'd:\fews\bin\windows\setEnvFromJsonBase64.ps1 ' base64(string(variables('env'))), ';', 'd:\fews\bin\windows\fssLauncherRegisterService.bat;', 'd:\fews\bin\windows\fssLauncherStartService.bat]"