Install msi with terraform

Hello,

Im new to terraform and i need some help please.

i have created terraform files to provision a new windows VM on azure and to join it to domain. So this is working fine, but i need now that after is joined to the domain automatoclly to install a client .msi software so the server can be managed. The msi is aroud 80mb.

the provisioned is simple like:

main.tf (configuration file)
variables.tf
domainjoin.tf (join domain informations)

so any idea how can i deploy this step ?

Thank you

From memory there is a VM extension resource that allows you to run a PowerShell script against the VM during the provisioning phase of the VM deployment. So you would write a PowerShell script that installs the .msi and store the script somewhere that Terraform can access it and use the VM extension resource to point to the script

Try using a null_resource with a WinRM connection to execute the ps1 file on the Windows node. You can try using the file provisioner to transfer the file to the node first.