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).
# Call the setEnvFromJsonBase64.ps1 script in Azure Custom Script Extension for Virtual Machine Scale Set "variables": { "env": { "FEWS_FSS_HOME_DIR": "d:\fss", "FEWS_FSS_INDEX_1_DATABASE_URL": "jdbc:postgresql://hostname:6001/fewsdb01", "FEWS_FSS_INDEX_1_DATABASE_USER": "username", "FEWS_FSS_INDEX_1_DATABASE_ENCRYPTED_PASSWORD": "fdsfewqfaksdkja==", "FEWS_FSS_INDEX_1_CLIENT_CONFIG_FILE_NAME": "fs_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:\bin";', 'Remove-Item -Path "d:\bin.zip";', 'd:\bin\windows\setEnvFromJsonBase64.ps1 ' base64(string(variables('env'))), ';', 'fssLauncherRegisterService.bat;', 'fssLauncherStartService.bat]"