https://pulumi.com logo
Title
b

billowy-army-68599

06/22/2022, 4:13 PM
c

curved-eye-56312

06/22/2022, 4:14 PM
Correct!
b

billowy-army-68599

06/22/2022, 4:18 PM
because azure-native is generated from the upstream Azure API, you can usually find what you need by searching the ARM API: https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/custom-script-linux
{
  "apiVersion": "2018-06-01",
  "type": "Microsoft.Compute/virtualMachines/extensions",
  "name": "virtualMachineName/config-app",
  "location": "[resourceGroup().location]",
  "dependsOn": [
    "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'),copyindex())]",
    "[variables('musicstoresqlName')]"
  ],
  "tags": {
    "displayName": "config-app"
  },
  "properties": {
    "publisher": "Microsoft.Compute",
    "type": "CustomScriptExtension",
    "typeHandlerVersion": "1.10",
    "autoUpgradeMinorVersion": true,
    "settings": {
      "timestamp": 123456789
    },
    "protectedSettings": {
      "commandToExecute": "myExecutionCommand",
      "storageAccountName": "myStorageAccountName",
      "storageAccountKey": "myStorageAccountKey",
      "managedIdentity": {},
      "fileUris": [
        "script location"
      ]
    }
  }
}
so in your case (assuming its windows) you'd set
protectedSettings: { commandToExecute }
or
protectedSettings: { fileUris }
c

curved-eye-56312

06/22/2022, 4:38 PM
I am actually trying to build a custom script for a Linux VM. I thought maybe there was a way to have the script file referenced on one of the fields, but if that's not the case then should I just replace
settings
with: `protectedSettings:
{ commands to execute
`}``?
b

billowy-army-68599

06/22/2022, 4:39 PM
@curved-eye-56312 that's:
protectedSettings: script <base64script
c

curved-eye-56312

06/22/2022, 4:40 PM
Thank you! I will take a closer look! 😀