Has anyone had success using the <VirtualMachineEx...
# azure
b
Has anyone had success using the VirtualMachineExtension resource to run a custom powershell script (https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/custom-script-windows) from a blob container? No matter what I try with
Settings
or
ProtectedSettings
, I keep getting errors back from Azure stating they haven't been able to decode the settings string 😕 I've verified the script works fine having manually deployed the script from Azure portal.
a
VirtualMachineExtensions
is the extensions you want to install on the VM (basically what you see under Extensions + applications in the portal). The Custom Script for Windows (
microsoft.compute.customscriptextension
) is the extension you have to have installed in order to run remote commands on the server. You can also invoke scripts via the
VirtualMachineRunCommandByVirtualMachine
interface which has a parameter for referencing a URI for the script you want to run and alternatively just provide the script content directly. https://www.pulumi.com/registry/packages/azure-native/api-docs/compute/virtualmachineruncommandbyvirtualmachine/ Edit: It also seems to be possible to invoke scripts via
VirtualMachineExtensions
with
type=CustomScriptExtension
and a specific payload if
VirtualMachineRunCommandByVirtualMachine
is not something you want, see: https://github.com/pulumi/pulumi-azure-native/issues/694#issuecomment-957817895