Azure AVD - Add VM to host pool - custom config

SenhorDolas 1,191 Reputation points
2021-11-01T12:07:17.067+00:00

Hi
I need to install sophos AV when new VM's are added to a host pool.
I can't script sophos installs via AIB as the application needs dynamic data from the Sophos Cloud Management Console to generealise the image and this is a manual job.

As such I am planning to deploy Sophos when a VM is added to a host pool via "ARM Template File URL":
However I have no idea how to script this .json file in order for this to work, I have googled quite a lot and this is the closer I got:

{
    "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
    "contentVersion": "1.0.0.0",
    "variables": {},
    "resources": [
        {
            "type": "Microsoft.Compute/virtualMachines/extensions",
            "apiVersion": "2018-06-01",
            "name": "[concat(parameters('vmName'),'/CustomScriptExtension')]",
            "location": "[resourceGroup().location]",
            "properties": {
                "publisher": "Microsoft.Compute",
                "type": "CustomScriptExtension",
                "typeHandlerVersion": "1.10",
                "autoUpgradeMinorVersion": true,
                "settings": {
                    "fileUris": [
                        "https://mystoracc.file.core.windows.net/scripts/sophos_install.ps1"
                    ],
                    "timestamp": 202101021
                },
                "protectedSettings": {
                    "commandToExecute": "powershell.exe -ExecutionPolicy Unrestricted -File sophos_install.ps1"
                }
            }
        }
    ]
}

But still not working.

I understand that the .json file should be stored on a blob and then the blob referenced on the AVD Post update custom configuration.

Any help would be awesome please!
Thanks all

Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,376 questions
{count} votes

Accepted answer
  1. Martin Ondrejka 81 Reputation points
    2022-06-12T19:04:55.573+00:00

    Hi,

    in general it's very disappointing that URL fields don't accept SAS tokens. Sometimes it's desired to not expose sensitive data in param file.

    Are there any plans to start supporting it?

    Thank you
    Regards
    Martin

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful