I'm trying to deploy Azure Windows VM with VM extension by Terraform that will install ADDS role for the Windows VM.
I have one Powershell script file for the installation named install_adds.ps1 from my local machine
The Terraform file of VM Extension as below:
resource "azurerm_virtual_machine_extension" "main" {
name = "extensionTest"
virtual_machine_id = azurerm_virtual_machine.main.id
publisher = "Microsoft.Azure.Extensions"
type = "CustomScript"
type_handler_version = "2.0"
settings = <<SETTINGS
{
"commandToExecute": "powershell.exe ./install_adds.ps1"
}
SETTINGS
}
I have deployed the VM Extension Terraform file but not working
I think my Terraform file syntax is wrong and the Windows does not run my PowerShell script.
Any way can run my local PowerShell Script by Terraform VM Extension file?