azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Can't provide waagent CustomData file using PS ARM

Open cohowap opened this issue 10 years ago • 1 comments

Hello,

With Azure CLI, you can provide custom data to a VM (https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-classic-inject-custom-data/)

With Azure Classic/Service Manager you can do provide it via Add-AzureProvisioningConfig https://msdn.microsoft.com/en-us/library/azure/dn495299.aspx?f=255&MSPPError=-2147217396

However, with ARM, there doesn't seem to be any option to do this.

Related: https://msdn.microsoft.com/en-us/library/azure/dn495299.aspx?f=255&MSPPError=-2147217396

In short, I need to provide CoreOS with my cloud-config.yml. The only way I seem to be able to do it is via a Custom Script extension, in which I need to write a bash script to echo it out. Dreading coding and maintaining that.

Thanks.

cohowap avatar May 10 '16 19:05 cohowap

@cohowap Use Set-AzureRmVmOperatingSystem cmdlet https://msdn.microsoft.com/en-us/library/mt603843(v=azure.200).aspx

Parameter Set: Linux
Set-AzureRmVMOperatingSystem [-VM] <PSVirtualMachine> [-Linux] [-ComputerName] <String> [-Credential] <PSCredential> [[-CustomData] <String> ] [[-DisablePasswordAuthentication]] [ <CommonParameters>]

Parameter Set: Windows
Set-AzureRmVMOperatingSystem [-VM] <PSVirtualMachine> [-Windows] [-ComputerName] <String> [-Credential] <PSCredential> [[-CustomData] <String> ] [[-ProvisionVMAgent]] [[-EnableAutoUpdate]] [[-TimeZone] <String> ] [[-WinRMHttp]] [ <CommonParameters>]

Parameter Set: WindowsWinRmHttps
Set-AzureRmVMOperatingSystem [-WinRMHttps] [-WinRMCertificateUrl] <System.Uri> [ <CommonParameters>]

singhkays avatar Sep 17 '16 04:09 singhkays