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

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

Upvotes: 0

Views: 1052

Answers (1)

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

Upvotes: 0

Related Questions