Setting up winrm in azure machine using terraform

221 views
Skip to first unread message

Alan GEORGE

unread,
May 22, 2019, 8:22:44 AM5/22/19
to Terraform
Hi All,

I am trying to create and doing some customization in azure using attached terraform file.

I need to setup the winrm service in the newly creating machine and needs to execute some powershell scripts there.

I was able to enable the  winrm http listener using below command 

os_profile_windows_config {
    winrm {
        protocol = "HTTP"
      }
    
  }

But while trying to execute the powershell script the remote connection were rejected.

On further debugging i was able to find the root cause of the issue . I need to configure the winrm setting like below.

winrm set winrm/config/service @{AllowUnencrypted="true"} 
winrm set winrm/config/service/auth @{Basic="true"} 

Executed the above step manually and able to connect winrm from terraform.


Could someone help me to do the same in terraform file?




Terraform.tf
Reply all
Reply to author
Forward
0 new messages