0

I am trying to add the WinRs support using the publically available ARM Template

I get the following error

Changing property 'windowsConfiguration.winRM.listeners' is not allowed  

Then I tried using the powershell script mentioned in this article at the end. I'm not sure if it's just me who found the script to be a little wrong, cos it wasn't sorking so I changed it to as below

$vm = Get-AzureRmVM -ResourceGroupName "dscwitharm" -Name "dscwitharm"

$credential = Get-Credential
$secretURL = (Get-AzureKeyVaultSecret -VaultName "nithishvault" -Name    "dscwitharmwinrs").Id
$vm = Set-AzureRmVMOperatingSystem -VM $vm  -Windows -ComputerName "dscwitharm" -Credential $credential -WinRMHttps -WinRMCertificateUrl $secretURL
$sourceVaultId = (Get-AzureRmKeyVault -ResourceGroupName "dscwitharm" -VaultName "nithishvault").ResourceId
$CertificateStore = "My"
$vm = Add-AzureRmVMSecret -VM $vm -SourceVaultId $sourceVaultId -CertificateStore $CertificateStore -CertificateUrl $secretURL


Update-AzureRmVM -ResourceGroupName "dscwitharm"  -VM $vm  

And I still get the same error. What am I missing?

> Changing property 'windowsConfiguration.winRM.listeners' is not allowed
  • 1
    I'm sorry, but why would you use ARM template that's specifically designed to deploy winrm https listener to deploy vm without winrm https listener? Deploy a regular vm, it comes with a winrm listener (you only have to adjust Network Security Group to allow connectivity). – 4c74356b41 Sep 04 '16 at 09:17
  • @4c74356b41 I didn't know that. But but actually I want to enable both, I started with simple WinRM and that itself failed. I've updated the question as above. – Nithish Inpursuit Ofhappiness Sep 04 '16 at 13:28
  • https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-ps-template/ have you tried this article? – 4c74356b41 Sep 04 '16 at 15:25

1 Answers1

0

This seems to be a known issue and I found a work around. The following template uses a customScript extension to execute PowerShell to create a self signed certificate and configure WinRm over HTTPS.

https://github.com/Azure/azure-quickstart-templates/tree/master/201-vm-winrm-windows

This is indeed a different approach from what the documentation article recommends ARM Tempate